At the Skull and Dagger, Abis Mal is complaining to Akbar about how he always gets defeated by Aladdin, so he decides to get revenge on him. He brings in "mood stones" to test them. Mechanicles shows up and tries to figure out a way to get revenge on Aladdin as well. He and Abis Mal meet and argue. The other thieves are disturbed by the two, and are about to fight them. In order to defeat the thieves, Mechanicles uses his mechanical beetle while Abis Mal uses a yellow mood stone, which is used to be scared.
After defeating the thieves, Abis Mal and Mechanicles team up to destroy Aladdin. At Mechanicles' lab, the two put the mood stones on the mechanical insects. Then Abis Mal tricks a woman into thinking that his brother is trapped in a cave. He gives her a map to give to Aladdin. Aladdin and the gang fly to a cave, which is Mechanicles' hideout. They go look for Abis Mal's "brother", but then find a dummy.
They realize they got tricked by Mechanicles and Abis Mal. Now they have to find a way out of the cave, and while they are doing so, the villains put the mood stones on Iago, Jasmine, Abu, and Carpet. Aladdin and Genie have a feeling that it is one of Mechanicles and Abis Mal's tricks, and they go on a search to see what it is. Mechanicles plans on pulling a big lever when they get to his hideout, but Abis Mal pulls it, and a giant mechanical mantis comes out of the ground and tries to attack the gang.
Aladdin and Genie jump off a cliff while the mantis captures their friends and brings them into Mechanicles' hideout. Aladdin and Genie take a railroad track to get to the hideout. Mechanicles and Abis Mal are still waiting for the two to arrive. The villains then start arguing and then start fighting, while Aladdin and Genie see the mood stones. Abis Mal and Mechanicles see the two and bring the mantis try to destroy them. When Genie is about to destroy the mantis, the villains put a purple mood stone on him, which makes him not want to destroy it.
Mechanicles and Abis Mal put the yellow mood stone to Aladdin to make him scared. They then get on the mantis to destroy him. Aladdin is hiding in a corner in fear, but when the villains say that they are going to destroy Jasmine, the mood stone explodes and Aladdin is back to normal and gets out of the corner. The mantis tries to snap Aladdin, but it misses. Then it accidentally knocks over a vat of molten metal, which makes the mantis melt. Then Aladdin pulls the mood stone levers, and all the stones leave Aladdin's friends.
Mechanicles' hideout then collapses, and the gang gets out. Mechanicles and Abis Mal get out of the collapsed mountain, with the white mood stone on Mechanicles and the green one on Abis Mal.