----------
In theory, if the duration is 8 seconds, it should emit 4 instances of chain lightnings. However, there are only 3 because the duration ends the loop before it can happen.
----------
It is actually caused by error introduced in the timing caused by you resetting the counter to 0 rather than subtracting the amount of time processed.
Basically you are discarding fractional time units because of 2 / 0.03 not being a whole number. As such the lightning part sees the ability duration not lasting 8, 10 or 12 seconds but rather 7.92, 9.9 and 11.88 seconds so throws out one less bolt than intended.
Set EC_IntervalCounter[EC_CurrentIndex] = 0.00
Set EC_CLGroup = (Units within EC_CLAoE of EC_CasterLoc[EC_CurrentIndex] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an enemy of EC_Player[EC_CurrentIndex]) Equal to True) and (
If we change it to conserve the remaining fractional time instead of discarding it then the system should correctly see the duration as 8, 10 or 12 seconds.
Set EC_IntervalCounter[EC_CurrentIndex] = (EC_IntervalCounter[EC_CurrentIndex] - EC_CLInterval)
Set EC_CLGroup = (Units within EC_CLAoE of EC_CasterLoc[EC_CurrentIndex] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an enemy of EC_Player[EC_CurrentIndex]) Equal to True) and (
In theory it should now produce the correct number of lightning bursts as timing should be accurate. However this may or may not be the case due to floating point error.
If you still do not get the correct number of lightning bursts try setting EC_CLInterval to something fractionally smaller than 2 seconds such as 1.9999 seconds.