First off, listing what is mentioned on the algorithm FAQ
SLOW - ATB takes twice as long to fill.
HASTE - ATB takes half as long to fill.
STOP - Timers associated with the target will not increase (ATB,...)
CONTROLLED - Monster's AI script is overridden. They will not follow any React scripts or Condition scripts and overrides being Flirted as well. When the controller's ATB fills up, they can make the monster issue one of the attacks that are listed under "Control" in the Monster Data section. The controller can choose who to target with the attack as well.
INITIATIVE: Wielder begins the battle with their ATB full (always gets the first chance to act, used by Masamune)
---------------------
6.11) ATB CALCULATION
---------------------
1) Everyone's ATB is a measure between 0 and 255.
2) Initial values at the start of battle = ??
3) Eveyone's ATB increases at a constant rate (unlike FF6-9).
4) Once someone's ATB reaches 255, they can perform an action.
5) After performing an action, their ATB gets "reset" and is calculated as follows:
i) Let N1 = 120 - Agility + (Equipment Weight/8). Minimum value = 1.
For Monsters, use Speed instead of Agility, Equipment Weight = 0.
ii) If they have Haste status, N1 = N1 / 2. Minimum value = 1.
iii) If they have Slow status, N1 = N1 * 2. Maximum value = 255.
Note that Haste and Slow are mutually exclusive statuses. You can only have one or the other, but never both at the same time.
iv) ATB = 255 - N1
In here, in point no. 4 the ATB is not increasing but actually decreasing as you can observe with the following memory addresses. When one of these address reaches 0, then the player/enemy will be able to perform their command:
7E3D7F XX 1st Player Timer Remaining Duration - ATB Gauge
7E3D8A XX 2nd Player Timer Remaining Duration - ATB Gauge
7E3D95 XX 3rd Player Timer Remaining Duration - ATB Gauge
7E3DA0 XX 4th Player Timer Remaining Duration - ATB Gauge
--------------------------------------------------------------------------------
7E3DAB XX 1st Enemy Timer Remaining Duration - ATB Gauge
7E3DB6 XX 2nd Enemy Timer Remaining Duration - ATB Gauge
7E3DC1 XX 3rd Enemy Timer Remaining Duration - ATB Gauge
7E3DCC XX 4th Enemy Timer Remaining Duration - ATB Gauge
7E3DD7 XX 5th Enemy Timer Remaining Duration - ATB Gauge
7E3DE2 XX 6th Enemy Timer Remaining Duration - ATB Gauge
7E3DED XX 7th Enemy Timer Remaining Duration - ATB Gauge
7E3DF8 XX 8th Enemy Timer Remaining Duration - ATB GaugeTherefore, point no. 4 is actually 0 and not 255 (do to the counter decreasing and not increasing)
I would like to note something about the Agility here, every time a battle starts, your Agility may be off by +/- 1 point. This will cause that characters (or enemies) with close or same speed to attack in different order than how they would in other battles.
11.2) AI SCRIPT
This denotes a list of commands that the monster will follow during battle. After each command, the monster must wait until his ATB fills again before he can execute the next command. The exceptions are Change Target and Set Variable which do not take up any time. Also, commands executed due to React: occur immediately. Note that "Nothing" indicates that no action is taken that round, but the ATB must still fill up before executing the next command. Once the end of the list is reached, the AI goes to the beginning of the list and continues the cycle.
Note that the monster will not follow its AI script if it has Berserk, Charm or Controlled Status and will not execute any React: scripts if it has Stop, Paralyze or Sleep Status.
When a monster reacts, his ATB momentarily changes to 1, so in the next tick (frame) it can perform the reaction and then goes back to where its ATB bar was.
I would like to point out that there is some kind of glitch with the Berserker's ATB, first off their first turn works different (I never bothered to check how, so I can't be more specific here) and also it seems that when a Berserker dies & stays death for some time, when you revive him he will immediately will answer with an attack (as if the counter would still run after being death, instead of restarting from "0").