How do I find the actorId (the actor using a specific skill) during battle

Hello;

I have a move skill that is a battle skill and I want to call a common event whenever that skill is used during battle that tells me which actorId is using the skill. I can see the skill getting used but BattleManager.actor() inside the common event seems to be null when the skill is used. And BattleManager.actor() is a battler not an ID anyway. So how do I get the actorId?

I just want a line in my common event to work--console.log( " Move Skill actorId:"+your answer here) to print out the actor Id of the skill user.

thanks for your time
yours
winkr7
BattleManager.actor().actorId() returns the id.
Thanks Alistair. When I try this in the Attack skill I get a null. This is probably because it is targeting an enemy and so there is no actor. I appreciate your help.
Hello,

you could alternatively use "$gameVariables.setValue(x, a.actorId());0" in your skill's damage formula and use console.log($gameVariables.value(x) + "text") in your common event. Replace both x with any variable number.

If your skill is supposed to deal damage, then just replace the 0 after the semicolon with your usual damage formula.
If you're trying to do this from a common event run by the skill:
Use "control variables" / "game data" / "last" - it can assign skill id, actor id / target id etc to variables.
(New feature of MZ so you don't need to script call as you did in MV)
Many thanks Coelocanth--that is just the thing I needed. I had not seen this new feature.
BattleManager.actor() is actually the "inputting actor", which doesn't exist when your skill is performed. That's why you're getting null.
I also have this need. Can anyone tell me how the MV can get the actorId of the current action in battle?

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-find-the-actorid-the-actor-using-a-specific-skill-during-battle.126461/