How do I make a friendly actor appear in a fight at a certain % of HP

Just as the title of the thread asks,
if I'm programming a battle, how do I make it so a friendly person joins the battle and helps you fight the enemy when either your actor reaches a certain % of Hit Points, or the enemy reaches a certain % of hit points?
For that you would need to add a tab to the "Troop" events of every battle that this can occur in. I'll post a quick pic I just threw together to show an example, it is the basic idea of how to do this and then you can add on extras from there. Hope it helps.

Untitled.jpg
EDIT: Whoops, got beaten to the punch. Ignore this please.
Just make sure to run a conditional check to make sure "Thex" isn't already in the party. I'm betting you don't want the event to trigger twice: when you hit 50% hp and again when the enemy does.
Ok thanks, meow.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-a-friendly-actor-appear-in-a-fight-at-a-certain-of-hp.95525/