MV What script call to check if actor is taking damage?

I am using SumrndmDde to make a custom battle HUD in MV. Frontview.

I want to display a picture, (e.g a lightning bolt) over my actors face when the actor is attacked.

In the "condition" field of Hud Maker, I need to put something like

Code:
BattleManager._targets._actorID==1

So that the picture will only display, if the actor ID being targeted is "1"

But it doesn't work. I'm not very familiar with JS or BattleManager so I'm not sure if I am even close.
Whats the best way of populating the "condition" on sumrndmDde Hud Maker so that my picture only shows whilst the actor is being attacked ?

Please help?

1642001339145.png
Can anyone help?
Bump?
Im looking for that too but im on MZ
Sadly I never got an answer 🙁 hope you have more luck than me
I will let you know friend !

PS : I finally found a way this morning ! but im not sure if it will work on mv too

In Hud maker make a variable condition like this for your picture.

and in your yanfly action sequence (for every enemy attack in order to know which actor is selected at the beginning of the action sequence) put this script call :
$gameVariables.setValue(19, BattleManager._targets[0].index());

It should work !
@dwiseman57 You had the right idea, but your JavaScript syntax was very wrong. Try:
Code:
BattleManager._targets.includes($gameActors.actor(1))

@Oxem In this case, it might work out for you. But as a general rule we're not supposed to necro-post, especially when your question isn't actually the same question as the existing thread (the code could be different in MZ).
@ATT_Turan I would expand the condition to something like this:
JavaScript:
BattleManager._targets.includes($gameActors.actor(1)) && BattleManager._subject.isEnemy()
Otherwise your damage indicators will also show up when an actor gets targeted by another actor's heal spell or similar. Of course the exact conditions you want would heavily depend on the specific project.
@eomereolsson Pssh, I often get a lightning bolt on my face when a friend heals me.

...good call. 😛
If i didn't, the thread will be remain unanswered. I didn't know about this rule.
Anyway hope it will work !

Original thread: https://forums.rpgmakerweb.com/threads/what-script-call-to-check-if-actor-is-taking-damage.143881/