What
@Uncle said, though I'd like to add one thing - be mindful of mana regeneration.
The condition above requires the target to be at exactly 0.00 mana. If you're going to check for it every second and the target has any mana regeneration, you'll have a hard time hitting the condition requirement, because the target will regenerate some mana in the meantime.
This is because mana regeneration happens in small time intervals, i.e.if a unit has 5 mana per second regeneration rate, that doesn't mean that it will gain exactly 5 mana once every second. Quite the opposite, in fact - it will recover a little bit of mana every fraction (not sure how small) of a second, which will add up to 5 mana regenerated over a full second. In other words, the unit will have 0.5 mana after 0.1 seconds, 1.0 mana after 0.2 seconds and so on.
If even one of these regeneration ticks happens between the target's mana being reduced to 0.00 and checking the condition, the unit will be above 0.00 mana and thus it will not meet the condition. One more thing to note here, the UI only displays full mana points that a unit has, so if a unit has, say, 0.67 mana, the UI will still display that as the unit having 0 mana. Only when the unit has at least 1.00 mana will it display as having 1 mana.
This will create a dissonance between what the player feels should be happening, i.e. "the unit has 0 mana, it should be taking damage" and what actually happens, i.e. "the unit has 1 > mana > 0, so the condition isn't passed and it doesn't take damage".
---
The easiest way to counter both of these issues is to simply remove any mana regeneration from the target unit and restore mana via triggers. That way you can control how much mana and in what time intervals your unit will regenerate. Alternatively, you could also try changing the condition to "less than 1.00 mana", so that it's based on the mana value displayed to the user, rather than the actual amount of mana the unit has.
Another option is to go for a simple system that deals damage proportionally to the amount of missing mana. In other words, if your unit is meant to lose 10 mana or 20 life per second, but only has 5 mana - 5 mana is 50% of the intended penalty, the othe 50% will be covered by losing life, i.e. the unit will lose all of its remaining mana (5 points) and 0.5 * base_life_penalty, i.e. 0.5 * 20 = 10 life. Here's how to do this:
-
Actions
-

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-


If - Conditions
-



(Mana of Target_Unit) Greater than or equal to Mana_Penalty -- first you check if the target has enough mana to "pay" the penalty
-


Then - Actions
-



Unit - Set mana of Target_Unit to ((Mana of Target_Unit) - Mana_Penalty) -- if it has, then you simply reduce it's mana by the intended amount
-


Else - Actions
-



Set Life_Penalty_Value = (((Mana_Penalty - (Mana of Target_Unit)) / Mana_Penalty) x Life_Penalty_Base) -- use this equation to calculate how much life needs to be deducted
-



Unit - Set life of Target_Unit to ((Life of Target_Unit) - Life_Penalty_Value) -- Reduce the target's life by the calculated amount
-



Unit - Set mana of Target_Unit to 0.00 -- set the target's mana to 0, because all mana the target had was removed by the penalty
Let's do some numbers, just to be sure. You want the target to lose 10 mana or 20 life and the target has 9 mana remaining, so:
Mana_Penalty = 10.0 ; Life_Penalty_Base = 20.0 ; Mana of Target_Unit = 9.0
Life_Penalty_Value = (10.0-9.0)/10.0 * 20.0 = 1.0/10.0 * 20.0 = 0.1 * 20.0 = 2.0
Thus, the target will go from 9.0 mana to 0.0 mana and also lose 2.0 life to compensate for the fact that it didn't have enough mana.
The main advantage of that last option is that it's the most fluid way of transitioning between losing mana and health, which allows you to completely ignore any mana regeration issues as the system is built to account for them. It should also be pretty easy to explain to the user, e.g. "while outside, the unit loses 10 mana every second. If the unit doesn't have enough mana, it will take up to 20 damage per second".
Ultimately though, it's your choice how you choose to handle this

Good luck!
