Pokémon Red Version, Blue Version, and Yellow Version - Last damage dealt
The "last damage dealt" variable begins at zero. It is set whenever the attack process determines the HP to reduce to an opposing Pokémon, usually by applying the damage formula. It is not reset by switching out. If an attack that would affect an opposing Pokémon (including a non-damaging attack) misses, fails, becomes ineffective, or otherwise doesn’t deal damage, this variable is set to zero. This variable is set before damage is passed to a substitute (therefore, Bide and Counter are affected by damage dealt to a substitute). Because each hit of a multi-hit attack deals damage separately, only the final hit of multi-hit attacks can count as the "last damage dealt" for the purposes of Bide and Counter. Recoil doesn’t count as "damage dealt". Damage from confusion, and HP loss because of a miss from Jump Kick and Hi Jump Kick, can count as the "last damage dealt".
The "last damage dealt" variable is shared among all Pokémon in battle.
Damage dealt is adjusted to the opposing Pokémon’s current HP, but not when the opposing Pokémon is a substitute.
When Metronome or Mirror Move is used, the "last damage dealt" is reset before that move uses the move it calls.
In Pokémon Stadium (known as Pokémon Stadium 2 in Japan), this variable is reset when switching out, being unable to move because of paralysis, or beginning to use a two-turn attack.
In the Game Boy games, this variable is not reset when a battle starts or ends, or when an item is used.