need help on script in locking enemy and use special skill in battle

So I create an enemy that transforms on death. that transform on death is a success, but problems are 'locking' it.

1.png
using Hime plugin, add enemy from troop 30 which is

4.png
-----
now the main part. as you see below, every 3 turn there will be rng. hit 2, add var for 'next event'.
(the checkpoint var is to prevent brown from trigger this event.)

2.png3.png
the problem is the force action can't lock to grey. force action subject only can for an enemy that already in the battle since the beginning.
how to add for an enemy that isn't in the battle, appears in the middle in the battle?

can't add event battle in troop 30. cause it's still troop 14 (brown), only enemy add.
Force Action should still work in this case; the code that runs it only cares about the enemy's ID, not what it actually is. It'll say Giant Ape in the box, but if enemy #1 is no longer Giant Ape when it runs, it should force whatever *is* enemy #1 to use Wheel Slam instead. (and if adding the enemy from troop 30 doesn't make it enemy #1, change the force action to affect #2 instead. It won't have a name in the troop event box but should still work in the battle itself)
Force Action should still work in this case; the code that runs it only cares about the enemy's ID, not what it actually is. It'll say Giant Ape in the box, but if enemy #1 is no longer Giant Ape when it runs, it should force whatever *is* enemy #1 to use Wheel Slam instead. (and if adding the enemy from troop 30 doesn't make it enemy #1, change the force action to affect #2 instead. It won't have a name in the troop event box but should still work in the battle itself)
ah, so it even work if it's ???. alright, thank you for the info.
after you mention, if enemy spot #1 is missing and the newly added enemy becomes #2, will the next added enemy will be #3 or fill the empty spot from #1 to #8?
Insofar as I'm aware (I couldn't quite remember when replying originally either) a removed or dead enemy is still part of the troop, it's just not on-screen. So adding a new one will be the next number up (this makes sense when you consider that in the default engine, even with enemies that appear mid-battle you can only have a maximum of 8 in the troop)

Original thread: https://forums.rpgmakerweb.com/threads/need-help-on-script-in-locking-enemy-and-use-special-skill-in-battle.134255/