Boss Mechanic

G'day folks!

As the title suggests, I'm working on a boss mechanic, and I could use some assistance. I'm not certain if what I want to do can be done, as per limitations of the engine.
I'm no stranger to complex events.

Is there a way, perhaps through a script call(?), to recognize whenever a specific enemy takes damage - doesn't matter how much - to then do x?

Specifically, there's a pair of eyes that act as buff for the boss. I'd like to set it up thus:
Boss is immune while the eyes are open. Player smacks the eyes, stunning them and they close for a set number of turns - much of this I can already do, it's the whole -enemy has been hit- that has me scratching my head.

Right now I've got this mechanic functioning in a workaround way, but not to the full extent I want it to (I've removed the eyes closed vs eyes open mechanic until I can figure it out, if at all possible).

So, -is- if possible to identify when a specific enemy in battle has been hit? I know I could do this through variable, and would that just be the best way to do it? Or is there another way? I've a tendency of over complicating things st times.

Thanks in advance!

Cheers,
~Lit
When a specific enemy is hitted it can be identified for example by a cursor or a health bar,
I've used the Yanfly Ace Battle Engine (https://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/)
with the HP bars addon (https://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/enemy-hp-bars/)
and made this little proyect based on your idea https://mega.nz/#!EgAxlRpD!Vg9vCWkR-ER3aPnU33FP8Ep3Kb_oVWqbGDcztXIfllU

For making the boss inmune while the boss eyes are open I just made his default def 999, (I think this can also be done by state, there's a script that may prove useful but I haven't tested it http://himeworks.com/2013/03/progressive-states/ ) and when you sucesfully hitted both eyes (that are enemies on their own) just transform the enemy into another one with less defense

Of course there are still problems like a little visual glitch everytime you hit the boss will open his eyes for a few frames and I didn't make it so it repeats the process again since once you hit the eyes they "die" I think this can be fixed by making them inmortal and then everytime you get the boss blind (by getting those eyes to HP = 1) it will restore those eyes HP after 3 turns and the dragon changes to have def 999 again, but then when you do kill the boss the eyes will still be there, but I found this other script http://himeworks.com/2013/11/synchronized-battlers/ that may fix that, is basically makes that once the boss is killed his eyes will also die, but that's just the way I see it
Hope it helps!
I know that in VX Ace, Game_Battler's make_damage_value, and Scene_Battle's invoke_item handles hitting stuff.

Hm, I would probably have something like this in make_damage_value, probably as an altered snippet for Game_Enemy:

Code:
if enemy?
  if @enemy_id == EYE and !state?(EYESCLOSED)
    add_state(EYESCLOSED)
  end
  if @enemy_id == OGRE
    blindogre = 0
    $game_troop.alive_members.each do |battler|
      blindogre += 1 if battler.enemy_id == EYE and battler.state?(EYESCLOSED)
    end
    value = 0 if blindogre < 2
  end
end
Code reads: If enemy is EYE, makes its eyes closed (make_damage_value probably assumes that you passed the evasion check at this point). If enemy is an ogre, count each eye that has its eye closed and change damage to 0 if there are less eyes closed.

Original thread: https://forums.rpgmakerweb.com/threads/boss-mechanic.83719/