Don't consider spells waiting on the GCD to be on cooldown.
Don't consider spells waiting on the GCD to be on cooldown.
This differs from the return value of Blizzard's GetSpellCooldown() but
makes more sense from the point of view of a player.
Adjust OvaleCooldown:GetSpellCooldown() to check for whether the GCD is
active and to consider a spell that is waiting on the GCD to just be ready
when the GCD is over. A spell is on cooldown only if the duration
returned by OvaleCooldown:GetSpellCooldown() is greater than zero.
Introduce a new state method GetTimeToSpell() that returns the time until
the spell is ready to cast, accounting for cooldowns and resource
requirements, and use it instead of very similar code in
OvaleBestAction:GetActionInfo() and the TimeToSpell() script condition.
Note that OvaleRunes is a core Ovale module since it provides state
methods that are needed for these computations to work.
This is the rest of the fix for ticket 494 by @Reason2012.