Ash uses Corphish in his Gym battle with Flannery. Flannery chooses Magcargo first, which is defeated by Corphish's Crabhammer.
Meanwhile, Team Rocket is digging a tunnel to steal Magcargo and Pikachu during the battle, but they accidentally hit a pipe and are sent blasting off into a hot spring.
Ash recalls Corphish and sends out Treecko, hitting Slugma hard but getting burned by Flamethrower. Ash sends out Corphish again, but Slugma uses Yawn to put Corphish to sleep. Pikachu goes out to battle next.
Pikachu knocks out Slugma with a powerful Thunder attack, but Flannery calls out Torkoal. Pikachu can't get through Torkoal's Iron Defense, and is KO'd by Overheat.
Treecko is sent out again, but is quickly knocked out by Overheat. Ash sends out the sleeping Corphish, who takes some damage before finally waking up. To get through the Iron Defense, Corphish hits Torkoal with Crabhammer from the side, flipping the Fire-type over and then knocking it out with Bubble Beam.
After the battle, Flannery receives some advice and praise from her grandfather, and presents Ash with his Heat Badge.
Ash is ready to earn his fourth Badge against Flannery, the Gym Leader from Lavaridge Town, and intends to charge ahead with Corphish. When the battle begins, Flannery begins with Magcargo, and Ash sends out Corphish. Meanwhile, Team Rocket is devising a plan to steal Magcargo and Pikachu right out from under them using their famous holes. As the battle starts, Ash starts off with a Bubble Beam, landing a direct hit. Flannery makes the next move with a Flamethrower, but Ash uses Corphish's Harden to minimize the damage taken. Ash continues to show his confidence, much to Flannery's distaste. As the battle goes on, Ash tries to use Corphish's Vise Grip to end it, but Flannery remembers something her grandfather said, and uses Reflect to completely block the hit. Ash is eventually able to take out Magcargo with a Crabhammer. Team Rocket is working hard on their tunnel, when suddenly, they hit a water pipe which sends them blasting off in the occurring geyser.
Ash and Flannery both recall their Pokémon. Ash sends out Treecko, much to everyone's surprise since its weak against Fire attacks, and Flannery sends out Slugma. Treecko successfully dodges Slugma's attacks and tries to move in for a Quick Attack, but right before it hits, it bounces right back, due to the Reflect that still protects Flannery's team. Treecko keeps attacking, eventually hitting with a Bullet Seed from close range, but also receives a nasty burn on its leg. Ash recalls Treecko and sends Corphish back out. Corphish attempts a Vise Grip, but is sent straight to sleep by a Yawn. Ash tries vainly to wake it up, but is eventually forced to recall it. Pikachu runs into the battle, dodging Slugma's Flamethrowers and manages to end the Reflect with Quick Attack. As the battle continues, Slugma hides in its Smog in order to attack Pikachu. Pikachu senses and finds Slugma and uses Iron Tail, but Slugma avoids it and uses Flamethrower which hits Pikachu. Pikachu unleashes a powerful Thunderbolt, electrifying the Smog and shocking Slugma. Flannery attempts a Yawn but Pikachu quickly uses Quick Attack and then Thunder to knock out Slugma.
Flannery's final Pokémon is Torkoal. Pikachu attempts both Thunderbolt and Iron Tail, but is shocked to discover that Torkoal's Iron Defense makes it completely useless. Torkoal uses Sludge Bomb; Pikachu dodges two bombs and gets hit by one. Ash tells Pikachu to not give up, and to use Thunder, but Iron Defense blocks it. Torkoal uses an incredibly powerful Overheat, landing a direct hit on Pikachu and knocking him out. Ash is now left with two Pokémon, an injured Treecko and a sleeping Corphish. Torkoal's Overheat quickly takes out Treecko, and Ash is left with Corphish. After taking multiple hits, Corphish finally wakes up. With Corphish awake, Ash must figure out how to counter Torkoal's Iron Defense. After hitting it on its side and forcing it out, Ash quickly moves in with Bubble Beam, knocking out Torkoal and winning the battle, earning Ash the Heat Badge.