MV How would I make a skill that lets you check on your team?

Issue Summary — I'm unsure how i would detect the target of a skill through a common event

Details — When used, I want it to have some dialogue which I plan on handling through a common event, I want to save a variable of who the skill targets, then use that to determine what text you get from the skill. EX: Actor 1 uses CHECK on Actor 2, making Actor 2 the target, save that variable so it can go to the common event and check the conditional branch for if Actor 2 is picked as the target. Then it would display the text and stuff which I can do easily.

Are you using any plugins? — YEP_InstantCast, this is so you can check your ally without using your turn.
The no script/plugin solution was to make the skill give the target a state (invisible with no icon etc), and then you check in the common event with conditionals which actor has that state, do the effects and then remove the state.
If it's a single target skill, I guess the script command BattleManager._targets[0] should return the target? So, BattleManager._targets[0]._actorId would return a friendly target's actor ID?
Without plugins, each target is shifted from BattleManager._targets immediately before the action is invoked on that target (BattleManager.updateAction). So by the time a Common Event attached to a skill runs, that global reference to the current target is long gone.

One workaround can be to store relevant information via the damage formula, e.g.

v[123] = b.isActor() ? b.actorId() : 0; 50
I.e. "if the target is an actor, store their actor ID in variable 123, else store 0; then return a value of 50 for the formula result". Then you can check that variable in your event as usual.

Alternatively you could look for a plugin that lets you run script calls with a target reference, e.g. one of the Skill notetags from YEP_SkillCore:
The no script/plugin solution was to make the skill give the target a state (invisible with no icon etc), and then you check in the common event with conditionals which actor has that state, do the effects and then remove the state.
This solution worked for me ^^ Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/how-would-i-make-a-skill-that-lets-you-check-on-your-team.177882/