From the Super Mario Wiki
In The Super Mario Bros. Super Show! episode "The Adventures of Sherlock Mario", Mario, Luigi, Toad, and Princess Toadstool venture to Herlock Solmes's home city of Victoria, in search of Herlock Solmes, who had agreed to meet them at midnight to discuss plans on helping them defeat King Koopa.
Before Mario, Luigi, Toad, and Princess Toadstool ever have the chance to meet him though, Herlock Solmes is kidnapped by Professor Kooparity, whose plans to destroy Victoria Herlock Solmes had discovered. Losing his hat and magnifying glass in a scuffle with Professor Kooparity, Herlock Solmes is taken to Professor Kooparity's sewer headquarters, where he is tied to a chair and mocked by Professor Kooparity, Mouser, Tryclyde, and a Koopa Troopa. As Professor Kooparity taunts Herlock Solmes, he jokingly says that he bets Herlock Solmes cannot figure out what Professor Kooparity is planning to do; Professor Kooparity is left dumbstruck though, when Herlock Solmes correctly deduces that Professor Kooparity, Mouser, Tryclyde, and the Koopa Troopa ar going to steal the Retro Router from the Tower of Victoria, and use it to flood all of Victoria.
Later, after Professor Kooparity, Mouser, Tryclyde, and the Koopa Troopa steal the Retro Router and are preparing to use it to flood Victoria, Professor Kooparity gloats that once he flooded Victoria, he would be one of the vilest villains ever, and asks Herlock Solmes, who is still tied to a chair, what he thinks of him now; after being asked this by Professor Kooparity, Herlock Solmes proceeds to reveal several embarrassing secrets of Professor Kooparity and mocks him, which enrages Professor Kooparity, and causes the nearby Mouser, Tryclyde, and Koopa Troopa to laugh hysterically.
Eventually, Herlock Solmes is released from his confinement by Professor Kooparity by Mario, Luigi, Toad, and Princess Toadstool, who manage to find Professor Kooparity's sewer headquarters. They defeat Professor Kooparity and the Koopa Pack, and destroy the Retro Router, stopping it from flooding all of Victoria.
Afterward, at Herlock Solmes's house on Bonkers Street, Herlock Solmes gratefully thanks Luigi, Toad, and Princess Toadstool for stopping Professor Kooparity from flooding Victoria, as Mario searches Herlock Solmes's house for some food. Before Herlock Solmes can stop him, Mario opens the carrying cage of the Killer Kitty of the Caskervilles, thinking it to be a lunchbox. Once freed by Mario, the Killer Kitty of the Caskervilles proceeds to clamp down on Mario's hand, leaving Herlock Solmes, Luigi, Toad, and Princess Toadstool to try and pull the Killer Kitty of the Caskervilles off Mario's hand.