Summoning and Unsummoning Characters

So I want to create a character that can summon a different character/creature of their choice during battle. So far I figured out how to summon the characters/creatures by creating an event that removes the main character from the party and the summon replaces them, and adding that to a skill that only that character can use. Each summon would have different abilities, strengths, and weaknesses. However, once the battle ends, the summon remains in the character's place. How can I make it so once a battle ends, the summon disappears and the character is back in my party?
How about using plugin that run after all enemies are defeated?

Run the event so that when battle ends, it will check whether there is summoned character in party. If there is, it will immediately change the character to its original party.
SomeRandomDude make a plugin in that sense

http://sumrndm.site/summon-core/

Here are 2 extensions to this plugin that you can find useful.

http://sumrndm.site/summon-battler-images/
http://sumrndm.site/replace-summons/
The links were very helpful! Thank You so much! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/summoning-and-unsummoning-characters.105269/