I was wandering if I can right a macro that basically

casts heroism if no combat and a certain person is alive or dead

So basically if I am not in combat it will cast heroism and check to see if a player is dead or not before casting.

I know I can do like

/cast [nocombat] Heroism

I am just not sure about the rest.