Random wildcard summon

Hello. I want it so that, when a specific party member is in battle, a monster has a random chance of appearing and attacking both enemies and allies. In more technical terms, I want an attack with an animation to play at random when this party member is in battle and for it to act outside of the his regular turns. Is this possible with events somehow?
EDIT: Also, I understand I can do something like this in each troop, but was unsure if I could do it without pasting the same event script in every battle and how to achieve the RNG factor
If you can do it in the troop tab, then make a common event and call it from the troop tab.
If you can do it in the troop tab, then make a common event and call it from the troop tab.
Makes sense. I could just make an event that checks if that member is in the party. I'm still not sure how I could apply RNG to it though.
If you want to achieve this with Troop Events I suggest Yanfly's Base Troop Event Script (http://yanfly.moe/2015/10/18/yep-15-base-troop-events/). Everything you event in the very first troop (0001) is applied to every other troop in your game, this saves you a lot of copypasting.
The RNG shouldn't be too hard to apply, just some simple playing around with variables. You can read up on that on various places 👋
Conditional branches & Variables should allow you to make it random. Set a variable with a range of say 1-5 with the event being pulled up if the Variable ends up being a 1. The greater the difference in the range, the less chance of it happening.

Original thread: https://forums.rpgmakerweb.com/threads/random-wildcard-summon.80562/