Targeting help?

I’m trying to set up a template that will work with most spells, but I’m trying to basically say like, Heroic throw or heroic leap, @mouseover, if target is hostile, then cast, if target is friendly, @targettarget until harm or @noexist. I can’t figure out how to get it written in, though. Any help would be greatly appreciated. I’ve read through hours of the forums and must have missed it.

Heroic Throw

Drop the [mod:alt,@player] condition set and change all the help to harm.

Heroic Leap