From the Super Mario Wiki
After his armies were decimated by giant-sized, ninja versions of Bully, Kooky, Big Mouth and Cheatsy Koopa, Prince Hugo called apon Mario, Luigi, Toad and Princess Toadstool to protect him, fearing that he was the next target of the Koopalings.
Unfortunately, Mario and Luigi were unable to protect Prince Hugo when the Koopalings attacked his castle, the two being preoccupied by the Angry Sun. After bashing their way into Prince Hugo's castle, Kooky and Cheatsy proceed to capture Prince Hugo, while Big Mouth and Bully Koopa captured Toad and Princess Toadstool.
Even as Mario and Luigi, having raccoon powers, appeared, they were useless in saving Prince Hugo, Princess Toadstool and Toad, as the two were easily defeated by the gigantic Koopalings. With Mario forced to retreat atop Prince Hugo's Parrot, the Koopalings transported Prince Hugo, Princess Toadstool, Toad and the recently captured Luigi to King Koopa's Castle.
It was in King Koopa's throne room that he inacted his plan to transform Prince Hugo into a poodle by using one of his wands. As a poodle, Prince Hugo was forced to suffer from the ridicule and mocking of King Koopa and the Koopalings and was seemingly unable to aid Mario, Princess Toadstool, Toad and Luigi in their battle against King Koopa, Cheatsy, Kooky, Bully and Big Mouth.
Eventually, after King Koopa and the Koopalings are defeated and forced to retreat from their castle, Prince Hugo is finally transformed back to normal by Princess Toadstool, by using King Koopa's wand, which had been dropped during the battle.
Having returned to normal, Prince Hugo began to gratefully thank Mario and shake his hand, accidentally flinging him to the ground after the spell that had made Mario gigantic was reversed by Princess Toadstool.