By default,
BattleManager._targets is populated with the full target list when the action starts. However, immediately prior to invoking the action on a target, that target gets shifted out of the list. So by the time your common event runs,
BattleManager._targets will be empty.
I don't think you need to check the result, though, since the damage formula only gets evaluated when the action hits. Without a plugin, you could try something like this in the damage formula:
$gameSwitches.setValue(123, true); 50
I.e. "turn on switch 123, then return a value of 50". Replace
50 with your damage formula and
123 with an appropriate switch ID. In the common event attached to the skill:
- Check if that switch is off (i.e. miss).
- At the end, always turn the switch off.
That way, the switch should be off at all times except when the skill hits.
Or like Turan mentions, just find an appropriate plugin, e.g. with
YEP Skill Core (untested):
<After Eval>
if (target.result().missed) {
user.gainHp(-50);
}
</After Eval>