Charge Beam additional effect chance glitch

The Charge Beam additional effect chance glitch is a glitch in the Generation V, VI, VII, and VIII core series games.

It first appeared in Pokémon Black and White and appeared in all subsequent core series games until Pokémon Sword and Shield, except Pokémon Let's Go, Pikachu! and Let's Go, Eevee!.

Effect

If the user has Serene Grace and uses Charge Beam while its side is under the effect of the rainbow from the combination of Fire Pledge and Water Pledge, the additional effect chance for Charge Beam will overflow and become 24%.[1]

Explanation

To multiply the additional effect chance due to the effects of both Serene Grace and the rainbow, a 16-bit signed integer is used. However, for moves that do not inflict status conditions, the additional effect chance is then stored in an 8-bit unsigned integer. ${\displaystyle 70\times 4=280}$  is greater than 255 (the maximum value for 8-bit integers); it subsequently becomes 24% when assigned to an 8-bit integer (when the most significant bits are truncated): ${\displaystyle \left(70\times 4\right){\bmod {2}}56=24}$ .

This glitch would affect all moves with a base additional effect chance between 64% and 88%. However, Charge Beam is the only move with an additional effect chance within that range.

Improper truncation still occurs for moves with an additional effect chance greater than 88%, but has no noticeable effect. Icy Wind, for example, has an additional effect chance of 100%, which will become ${\displaystyle \left(100\times 4\right){\bmod {2}}56=144}$ , which is set to 100 (just like the correct value of 400 would have).

This glitch is not present for moves that can inflict status conditions, as that percentage is consistently stored in 16-bit integers. Flinching is not affected either, as the Serene Grace and rainbow multipliers do not stack for flinching.