For some reference, info on the 5-second mana regen rule can be found here:
http://www.wowwiki.com/5_second_rule
In the WoWI IRC room, we were discussing the best way to make an addon that has a countdown for the 5-second rule. We had two main ideas:
1. event: SPELLCAST_STOP
Problem: Spells that cost no mana do NOT trigger the 5-second rule.
2. When the caster loses mana
Problem: Sometimes the caster will lose mana due to spells like Mana Drain or Viper Sting.
The conclusion we came to is that in pve, #2 would be better as not many mobs drain mana, but you will likely be using spells with no mana cost.
In pvp, #1 would be better as many people use mana-draining abilities.
Can anybody think of any good way to find the time that the 5-second rule starts?