Ticks left before the next attack may land.
A 4-tick weapon reads 3, 2, 1, 0, 3, ...: 0 on the tick before each swing. One tracker per client, observed every tick and brought up to date before a read, so onGameTick reads this tick's swing. It arms on an attack animation (the worn weapon's own, or another known attack animation) while attacking an NPC with an Attack option or a level and health, a player, or nothing, and on a new attackable NPC target while it reads 0; never on a block, an eat or a drink. The speed is the same as attackSpeedTicks (4 unarmed, one less on Rapid, the fixed overrides), and one less under the Blood moon set. An autocast counts 5 ticks, the game's cycle; an animation that outlasts the cycle (the Blowpipe, the Eye of Ayak) arms once the delay is 0; an eat's delay is added only for an eat the sustain manager queues (when it queues it), never from the "You eat" line; a spell cast with no animation and the Salamander are not counted (setAttackCooldownTicks and reduceNextAttackCooldownTicks correct it); on a client build that cannot read the animation's frame, a swing that restarts under the same animation is seen only once the animation ends.