A Dragon's Firebreath or Fireball should never miss.

- Dragon Firebreath Timing.jpg (105.05 KiB) Viewed 1502 times
The screenshot above shows a dragonai script with timer logging added. The values are in ticks and not seconds, 1 tick = 0.25 seconds.
There are 2 timers in operation here, the first one is the breathing timer (0x65) which ranges from to 7-14 seconds, the second one (0x64) prevents a firebreath and is triggered by an active fireball and also ranges from 7-14 seconds.
Since timer 0x65 runs continuously the first fireball can happen from 0-13.75 seconds. The delay between two fireballs ranges from 8.00 seconds up to 28 seconds, this is due to the usage of two timers both started at same tick.
Example:
Timer 1 (0x65): randomized value = 8 seconds (or 32 ticks)
Timer 2 (0x64): randomized value = 7 seconds (or 28 ticks)
Timer 2 ends before Timer 1 and will not prevent a fire attack.
Example:
Timer 1 (0x65): randomized value = 7 seconds (or 28 ticks)
Timer 2 (0x64): randomized value = 8 seconds (or 32 ticks)
Timer 1 ends but because Timer 2 is still active, a fire attack is prevented and Timer 1 is restarted using a new randomized value.
Example:
Timer 1 (0x65): randomized value = 14 seconds (or 56 ticks)
Timer 2 (0x64): randomized value = 14 seconds (or 56 ticks)
Timer 1 ends first (due to queue) and because Timer 2 is still active, a fire attack is prevented and Timer 1 is restarted using a new randomized value and if you are unlucky (sorry, ...your dragon is...) this will be 14 seconds.
As shown on the screenshot, in my test the minimum time registered between two attacks was 33 ticks or 8.25 seconds and the maximum time was 102 ticks or 25.5 seconds. These value differ slightly from the calculations above and this seems to be due to one extra tick being added to the callback at the core level.
The "skips" on the screenshot are prevented fireballs caused by the second timer.