#1
-
Actions
-
Set NewHP = (Max(1.00, ((Life of CasterUnit) - HealthCost)))
-
Unit - Set life of CasterUnit to NewHP
This will decrease Health of CasterUnit by the "HealthCost" of the spell. If he should end up with less than 1 health this way, his health will be set to 1 instead.
You don't need to use variables like I did in the example - you can make the calculation in the "Unit - Set life" line, I just put it in the "NewHp" variable so it is easy to take in.
#2
First, you need to catch when the unit takes damage.
If you want this spell for specific unit only (like some specific hero), you will need to use the event "Unit - Unit takes damage". If you want to use this for many units and you don't know how many (for example for Footman unit, etc.), the best way is to use Damage Detection System.
This is how the trigger looks for specific unit:
-
Trigger
-
Events
-
Unit - "Your Unit" Takes damage
-
Conditions
-
Actions
-
Set unit_var = (Triggering unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Life of unit_var) - (Damage taken)) Less than 0.41
-
Then - Actions
-
Unit - Set life of unit_var to ((Damage taken) + 0.41)
-
Else - Actions
-
Set unit_var = No unit
You check if the "Current health - damage taken" is less than 0.41 (units with less health are considered dead). If yes, you increase health by "Damage taken" amount.
(tbh this may not even require the whole ITE block as you may want to put the ITE's condition into the Condition block of the trigger)
The bad thing is that if unit takes damage, which is greater than that unit's total health, it will still kill it (this, however, is "fixed" in DDS).
If you use DDS, the trigger will be practically the same, but the "Event" will be different and instead of "Damage Taken" you will use a variable.
#3
If you mean an AoE Silence, then there is a Silence ability used by Dark Ranged or Cloud ability used by Dragonhawk Rider. If you mean specific target, there is Soul Burn used by Fire Lord.