Determining Which Actor is Targeted and Determining Which Enemy is Targeting

I am using common events for battle skills.
There are two actor, #1 and #2. When an enemy uses a particular skill, a common event is called to check to see what weapons each actor has equipped and sets a variable to a certain number based on that weapon. I then get a random number and compare that to one of the variables to see whether or not to have an enemy use a second skill. This works fine.

But, I have two problems.
#1: The variable that needs to be checked is determined by which actor is being being targeted. How do I get the event to know which actor is being targeted?

#2: The second skill needs to be used by the enemy that used the first skill. How do get the event to know which enemy used the first skill and have that enemy use the second skill?

For the second issue, I believe I can make multiple copies of enemies and skills, then make sure that certain copies are always in certain positions in the troop because the force action will only allow me to select an enemy by its location in the troop. I was hoping that I am missing something and that there is an easier way. For first issue, I have no idea what to do.
So...there are a few approaches I can think of. I'll give you things to try in-game first. The big trick here is that a common event attached to a skill technically gets called after the skill is executed. That means I believe it is no longer that battler's turn by the time you're in the event, so I'm not sure these will work...but you can try them.
#1: The variable that needs to be checked is determined by which actor is being being targeted. How do I get the event to know which actor is being targeted?
BattleManager._subject._lastTargetIndex holds the team index for the battler that was targeted. This is not the ID, but their index - that is, X in $gameTroop.members()[X]
#2: The second skill needs to be used by the enemy that used the first skill. How do get the event to know which enemy used the first skill and have that enemy use the second skill?
That would be just BattleManager._subject

Again, my initial prediction is that these won't work by the time you get to a common event.

So my other suggestion for how to make this work - which is much simpler than trying to make multiple copies of enemies and skills and have complicated events, but does have a learning curve - is to use Yanfly's Action Sequences.

It's a free series of plugins that allows you to program how your skills work, and it knows exactly who is using the skill and who the target is. So there's learning on your part for how to program the skill the way you want using Yanfly's commands, but then what you want to do is simple to achieve.

Original thread: https://forums.rpgmakerweb.com/threads/determining-which-actor-is-targeted-and-determining-which-enemy-is-targeting.139386/