While escaping a rainstorm, Ash and his friends enter what at first seems to be an empty castle. Soon after entering they hear a screaming and rush to the source, which turns out to be people receiving medical care from Pokémon. As Dr. Anna introduces herself, her assistant nurse, Keiko, reminds her that it is time for the Zubat scan. The group follows Dr. Anna into the procedure room, where a Zubat wearing a green bow hovers over a man and uses its supersonic sound waves as an ultrasound. Dr. Anna explains that her clinic uses Pokémon to diagnose and treat medical problems in humans. Machoke uses its strength to treat back problems, Spinarak uses its web to make bandages, and Mareep's electricity stimulates muscles. She explains that the Pokémon and her work together, and the Zubat with the green ribbon is revealed to be nicknamed Mimi. Misty asks why she works here, to which Dr. Anna explains that a patient of hers used to live here and now lets her run her clinic in the mansion.
As Dr. Anna is about to leave to make her rounds, Brock interrupts to show her his Zubat. Mimi and Brock's Zubat hover in the air together, prompting Brock to declare that they are a perfect team. He suggests that he and Dr. Anna could be a perfect team too. When Dr. Anna hesitates, he offers to at least use his Zubat to help her and Mimi make their rounds as thanks for allowing the group to seek shelter from the rainstorm.
Meanwhile, Team Rocket have sneaked into the castle through the back way. They are intially frightened by a sound and a mysterious shadow that appears behind them, but it turns out to be Wobbuffet. Jessie scolds her Pokémon before returning him back to his Poké Ball. Team Rocket then finds the castle's food pantry and begins to eat. Their feast is abruptly ended when Keiko guides Ash and Misty to the room for a snack.
Meanwhile, Brock, Dr. Anna, and their Zubat are walking down a corridor, with Brock's Geodude and Pineco carrying boxes. Dr. Anna asks Brock about his training to become a Pokémon Breeder, and Brock says that he was training until he met her. As he explains his intent to use his Pokémon to assist in human medicine, Team Rocket runs by with James carrying a sack of stolen food. Dr. Anna yells at them, inquiring if they have an appointment, prompting Team Rocket to temporarily stop and recite their motto. Ash, Misty, and Keiko come running and shouting for Team Rocket to give back the stolen food, but Team Rocket refuses. Ash orders Pikachu to get them, but Team Rocket flees down a hall, with Dr. Anna, Brock, and their Zubat pursuing them. Dr. Anna tries to warn Team Rocket about the hall, but they, along with Brock, Dr. Anna, and the two Zubat, end up sliding down a hidden passage, and a wall closes behind them.
Dr. Anna turns on the lights in the underground passage. She and Brock realize that there is no way to climb back up the way they came. Team Rocket starts to go another way before Dr. Anna asks them what they were doing; they say they are leaving and ignore Dr. Anna's warning to stop. They hit a wall that pops up in their way, and Dr. Anna says that there is no telling what will pop up in a maze like this. She then opens up her laptop and orders Mimi to use Supersonic, which then downloads onto the laptop. Brock orders his Zubat to use Supersonic in order to reveal the rest of the maze. Dr. Anna reads the map to decide which way to go.
Meanwhile, Ash and Misty discuss the maze with Keiko, who points out the location of the maze's exit, which is in the middle of the forest. Back in the maze, two paths are discovered, both of which seem dangerous, according to Dr. Anna's map. Ash, Misty, and Keiko reach the maze exit on foot, only to find it covered up with dirt and gravel, and they decide to dig it up. Underground, Dr. Anna tries to figure out which way to go, as Jessie grows impatient and charges ahead with her Wobbuffet right into another wall. Dr. Anna's laptop shows that activating one route opens the other one up. They go on until the laptop alerts them of another obstacle, which turns out to be another wall that Jessie and Wobbuffet run into. Dr. Anna realizes the traps are triggered by someone walking across the floor.
They all finally reach the exit, which has by then been dug out by the others. James suddenly bags the two Zubat, upon which Team Rocket runs to the exit and hit the stuck door. On the other side of the door, Ash, Misty, and Keiko give up trying to push the door open. Pineco uses Self-Destruct and blows the door open, during which the Zubat escape and Brock and Dr. Anna emerge from the maze. As Pikachu looks down at the maze corridor, he is lassoed and pulled in by Team Rocket, who rushes out of the maze and into the forest, carrying Pikachu in an electricity-proof bell jar. James orders Weezing to use Smokescreen, but Brock's Zubat and Mimi blow the smoke away. Jessie sends out Arbok and orders it to use Poison Sting. Before it can attack, however, Brock's Zubat uses Supersonic, which confuses Arbok into attacking Team Rocket. It then evolves into Golbat. Arbok recovers and uses Poison Sting against Golbat, but it deflects it with Wing Attack. Then, it uses Supersonic against Arbok and Weezing, but its sheer power also malfunctions Dr. Anna's laptop. During the chaos, the jar containing Pikachu is dropped and broken. Now free, Pikachu uses Thunder Shock to blast Team Rocket away.
Back in the castle, Brock intends on staying with Dr. Anna to become a doctor, so he prepares to say goodbye to Ash and Misty. Though Dr. Anna tells Brock that Golbat's Supersonic is too strong to use for her medical practice, which shatters Brock's dreams of marrying Dr. Anna in the process. The group bids farewell to her and resumes their journey towards Ecruteak City.