Get ID of actor who is currently being targeted by enemy?

The 'Last Target Actor ID' doesn't work in this case. It seems like it behaves more like 'the last one you issued a command to'. Which makes sense I guess 😛

So is there a way to get the ID of whichever actor is currently being attacked. I've been looking at the script call reference all morning but nothing has stood out. >.o

Edit: Should probably mention I'm using Visustella Battle Core plugin

lG95a38.png
This should work, storing the Actor ID in Variable 1:

Code:
$gameVariables.setValue(1, BattleManager._targets[BattleManager._action._targetIndex+1].actorId())

There might be a cleaner solution out there, though, which I would definitely suggest using if someone else suggests it. I'm only writing this in case you don't get other answers.

I really love the illustration, by the way! 😀
lol thanks! I figured I'd add the illustration since I kinda suck at explaining things 😛
Yes, that bit of code worked. Dirty or not lol If it can be cleaned up, I will try (or I'd better just leave it alone for now)

Original thread: https://forums.rpgmakerweb.com/threads/get-id-of-actor-who-is-currently-being-targeted-by-enemy.150064/