Sort of depends on what restrictions, if any, you want to impose on this. If you restrict things to only a mob that you are currently targeting, then you can use the UNIT_HEALTH event since it will give you a unit ID in arg1 and so you can compare it with your current target with
|
Source code
|
1
|
UnitIsUnit("target", arg1)
|
Otherwise, you'll have to do some fancy footwork to track units you have attacked and monitor them that way. If so, then you'll likely also want to track their target (via the UNIT_TARGET_CHANGED event) in case they loose focus (as in you ran out of range of the mobs area, you died, etc). If they do, or die, remove them from the tracking list. You may also want to remove a unit from the list after a reasonable amount of time has gone by so that you don't clutter your tracking list too much.