You are almost right.
From the beginning, Hideyoshi's ambitious was toward to a China(ming). but Korea(Joseon) rejected cooperate with japanese invasion, so battle deployed at Korean Peninsula.
First japanese army trained and increased through the sengoku period, with a lot of improved muskets drived out joseon and ming alliance army. but later more reinforcements of ming arrived, and lack of supply due to the defeat of japanese navy against korean navy with turtle ships led by Admiral Yi Sun-sin. and Hideyoshi's death. by these situations, japanese army retreated from korea.
Korean turtle ship is attractive indeed. but without support of naval units in megaglest, korean faction would be just a lesser Chinese faction.