the mod option can be found under "Math - Modulo".
The reason why it doesn't increase any attack speed is because you immediately give your unit the maximum attack speed.
This is basically your If/Then/Else (ITE) structure:
Code:
If (Conditions)
%Hp is greater than 70/50/30/10%
Then (Actions)
Set level of (+10) ability to max allowed
Set level of (+1) ability to 1
Else
Set level of (+10) ability to calculated amount
Set level of (+1) ability to calculated amount
Example situation: Your hero has 80% hp and level 1 of the ability. 80% is greater than the 70% limit, so he goes to the "Then" block which sets the bonus AS to the max allowed amount. I think you just need to set the condition from "Greater than" to "Less than".
There is a way to make this work without ITE however. That's by using the "Math - Min" function. This function takes two parameters (two numbers) and returns to you the lesser one of the two. So you could do for example this:
-
Set X = (Integer((100.00 - (Percentage life of Viking_User))))
-
Set X = (Min(X, (10 + (20 x (Level of Viking Speed for Viking_User)))))
-
... now here is the Y and Z calculation, etc.
So what this does is that it gets two numbers and returns you the lesser one of the two. At level 1 the limit is 30% AS, so if your hero has 80% Hp, then the bonus should be 20%. Min(20,30) returns 20 so it's all OK.
But if your hero had for example 45% Hp, then the bonus should be 55%. Min(55,30) is 30, so he's stuck at getting 30% attack speed.
That way you need no ITE.
As for the 1% AS per 2% lost Hp, I guess you could first divide the X amount by 2 before checking it via the Min function?
For example your hero has 30% Hp and level 2 of the ability, meaning the check should be max 50% AS. Now because hero has 30%, that means 70% is lost. If you divide 70/2, you get 35% increased attack speed. Then check via Min(35, 50), which returns 35% (I guess the limit is losing its purpose here, but it matters not ATM).