How do you grab the information of an actor who uses a skill that triggers common event?

I have a skill that causes a common event to play.

During the event choices will appear and I'm trying to configure the actor's stats based on what choices they choose.

Ex)
-If option A is chosen during this common event, then the actor who used the skill will unlock a class.
-If option B is chosen during this common event, then the actor who used the skill will lose HP

How do I adjust it so that the player who used the skill will be the one unlocking a class or losing health?

I'm thinking about storing the actor ID into a variable, and then referencing that variable but I'm not sure how to grab the player ID.
JavaScript:
BattleManager._subject._actorId

Will give you the currently acting actor's ID, which you can assign to a variable using the script box at the bottom of the Control Variables event command.
MZ comes with a new "last" category under Control Variables > Game Data > Last

Which will include the Actor ID that acted last, as well as the skill or item they used, and who they targeted.

Edit: And I see this the MV support forum and that doesn't help. Sorry.
JavaScript:
BattleManager._subject._actorId

Will give you the currently acting actor's ID, which you can assign to a variable using the script box at the bottom of the Control Variables event command.
Thanks!

I'm struggling with the next step of trying to change the actor's health.

Im using:

this.changeHp($gameParty.members()[$gameVariables.value(1)], -100, true)

and it doesn't seem to work. Is my formatting wrong?
$gameParty.members() is an array. By referencing $gameParty.members()[x] you are going to get the actor in that index of the array. The index is different than the actor ID.

If you want to get a specific actor by their actor ID, you need:

JavaScript:
$gameActors.actor(id)

I’m not currently at my PC to check the script call syntax that you posted, but if you are doing all of this in one event during one actor’s turn, this would be easier:

JavaScript:
const actor = BattleManager._subject;
const value = -100;
actor.gainHp(value);

Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-grab-the-information-of-an-actor-who-uses-a-skill-that-triggers-common-event.155089/