Or simply register custom callback to onHealthChange/onManaChange CreatureEvent's and code that in LUA:
onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage...