Recognizing Actor Targeted by Enemy

Hello! I am working on implementing a custom state. This state is called mark and it increases the damage of a particular damage type by 50%. Mark can be stacked on a target up to 4 times (Mark I - Mark IV). I've gotten everything to work when targeting enemies, but I'm struggling to get this to work when enemies target party members.

Here is what I'm working with. Ann is actor 0006. Ideally, when she is targeted with a skill that contains this common event, the event will check to see what level of mark she is currently on and increase it by one. I think my script must be off because nothing happens when this is tested. If I remove the script, anytime a skill targets any party member, all party members will have their mark stack increased. It needs to be targeted, but I'm not sure how to go about it beyond what I've attempted below.

I'm hoping someone better at coding than me can provide a quick fix for this! I'm also curious if there is a way to print to battle log (so I can inform the player that Mark has been increased) but that's probably a whole different can of worms.

Screenshot 2025-12-20 at 11.08.12 AM.png
Your conditional script returns an actor object. If you want the id you need to add .actorId() to the end. Though I haven't checked at what point that target is set and cleared. You can get Last Target Actor Id in control variables -> game data.

You can add to the battle log like this, in script box:

const text = "Mark was added";
BattleManager._logWindow.push("addText", text);
BattleManager._logWindow.push("wait");
BattleManager._logWindow.push("clear");
Well this solves all my problems. The Last Target Actor Id variable is what ended up working.

I appreciate the detailed and accurate help! Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/recognizing-actor-targeted-by-enemy.181535/