Basic skeleton for battle detection.
Add damage to MT_Attacked message.
Basic damage rate tracking.
Factor out updateDamageRate() function.
Implement state change messages.
Switch tracks on basis of battle state.
Move battle state check into OnSimulationUpdate().
Implement peace threshold.
Remove strange duplicate of BattleDetection.prototype.OnGlobalAttacked.
Implement getter for BattleDetection state property.
Move cmpPlayer definition inside if-statement.
Add explanation of alertness calculation.
Clarified usage of StartTimer(), and stop timer if called erroneously.
Grammar fix.
Record damage per timer period rather than per attack.
Indentation fix.
Expand damage rate explanation.
Define damage rate as total damage dealt per unit 'interval' over the previous timer period.
Base damage rate on damage done instead of damage dealt.