I don't really see a problem. Try using this..
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if not attacker or not creature then
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
if...