I've read all of your post (before your edit), but since it seems I didn't explain myself correctly let me rephrase that.
I didn't use your code when I posted. I should have said that in the first place.
I actually used the "real" DefenceMulSet code.
[State 0, DefenceMulSet]
type = DefenceMulSet
;trigger1 =
;value = 1
;ignorehitpause =
;persistent =
This one. I was talking about this. This code works from the second hit.
For .5, I get 12 for LP, just as I should. If I plug in .2, I get 5, just as I should.
I don't get why you're bringing up division by 0 when that's not happening in this:
[State -2, DefenseMulSet]
type = LifeAdd
triggerall = Alive && MoveType = H
trigger1 = (FVar(8) - life)>0
value = floor(([insert value here] - 1.0) * ifElse((FVar(8)-life) < life, -(FVar(8) - life),0))
... at all.
You're using lifeadd codes, to simulate how the defencemulset code should work, since the real defencemulset is considered to be broken; but it's not and I was explaining that.
About the dividing by 0, don't care about it, it was another test of mine. And I was wrong, the second/third/fourth hit deals 1 point of damage.
I tested this code on KFM: (remember, it's a test I did)
[State -2, DefenceMulSet]
type = DefenceMulSet
trigger1 = 1
value = 0.5
;ignorehitpause =
;persistent =
(I put it on statedef -2)
Let me show you with a gif:
This is when he has the DefenceMulSet (not your code) activated;
This is when he has no DMS:
Do you see the difference? One deals 55 (DMS = 0.5), the other does 73 (no DMS, or DMS = 1); that because it works from the second hit.
No alterations were made to KFM other than the DMS.
DefenceMulSet = 0
...