Record how many times a skill has been used on an enemy?

Hey all, I'm slowly waking up from my slumber. I need to work on my short game today, but I've hit a speed bump (or a solid wall lol) so I'm reaching out for help on this one...

So I've got a skill that I need to be able to be used on an enemy ID just one time. Not once per battle, ONCE on that enemy ID then never again. It's fine if the skill is allowed to be used, but then inform the player they've already 'captured' that enemy. The skill in question is an action sequence common event. I foresee the solution being a script in a conditional branch, but I have no idea what to write, and I'm already a bit rusty since I haven't been active for a couple of months.

Help? XD
Hmmm, I think:

$gameVariables.setValue(100, []);

Then a conditional in action sequence:
IF $gameVariables.value(100).includes($target.enemyId())
-> SHOW TEXT
ELSE
->$gameVariables.value(100).push($target.enemyId());

PS. To use that $target you need VS Core Engine ON.
Thank you, Lord. I'll give it a try here shortly ^^

Edit: I tried it... no dice. But since I'm not a programmer, I don't really grasp what the code is doing.
Would anyone mind explaining what the various parts of the code that Lord suggested actually do? XD
Did you set the variable in an event outside the action sequence, before battle? Only the conditional goes into the action sequence.

EDIT: So, you need to set the variable only once (at the start of the game). You make it an empty array, where you can store the IDs of the enemies you have encountered. But don't use the line again, or you will make it empty again and lose the stored information.
You can call a common event in the skill effects (on page 4) and put anything you need to do in there.
@rpgLord69 Oh... I set the variable within the action sequence common even like a dummy, because I was using the battle test from the editor. XD I'll be a bit busy today, but I'll make some time to try again later. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/record-how-many-times-a-skill-has-been-used-on-an-enemy.166944/