The Berserk Gene (Japanese: はかいのいでんしDestructive Gene) is a type of consumable held item exclusive to the Generation II games. It is heavily associated with Mewtwo.
It raises the holder's Attack stat by two levels as soon as it enters battle. It also inflicts confusion on the holder. It is consumed upon use.
In the handheld games, the Berserk Gene does not actually set the number of turns the holder is confused for, unlike moves that can confuse. The condition for the confusion status is that if the number of remaining turns for it becomes zero after subtracting 1 from the counter, the Pokémon recovers from confusion. As a result, if the number of turns it is confused for is 0, each time the Pokémon tries to use a move, the game will subtract 1 from the number of turns, but it underflows to 255 due to the use of an unsigned byte, resulting in confusion that lasts for 256 turns in battle. If a confused Pokémon is switched out and replaced by a Pokémon holding a Berserk Gene, the holder will be confused for the remaining duration of the first Pokémon's confusion.
In Pokémon Stadium 2, confusion from a Berserk Gene is properly configured to last 2 to 5 turns.
The Berserk Gene is consumed even if the holder is already confused or already has +6 Attack stages when it enters battle (due to Baton Pass).
Spoiler warning: this article may contain major plot or ending details.
In Detective Pikachu, the Berserk Gene is referenced several times as part of the drug known as R, which can momentarily make Pokémon more powerful, but also causes them to become berserk. Its effects derive from Mewtwo's cells and the Berserk Gene within them.
Spoilers end here.
Trivia
In the game data of Pokémon Gold, Silver, and Crystal, Mewtwo is defined to always hold a Berserk Gene when encountered in the wild. However, Mewtwo cannot be encountered in the wild in these games, so this data is unused.
Even if Mewtwo could be encountered in the wild, the Berserk Gene would be consumed immediately, so the player would not be able to obtain a Berserk Gene from wild Mewtwo.