[SOLVED]Help with my Type of damage calculation formula

Hey there,
if possible i need help with the first condition of this formula

How it works:
Basically it will double the damage depending on (floor enemy) type of resistance.
To simplify thing this one have only physical and fire resistance.

The variable p1hit.Variable(FIRE) can be 1 or 0 and it indicates if the damage is eg fire.

The formula works but i’ve a problem when for eg i assign to an enemy a 50% of fire resistance (FloorE.fireres=0.5)…bcs it will half the phys dmg by 50%…something i don’t want…
Looking for help, if some experienced user have a way to fix the formula.

Thx in advance

*more infos: *
p1hit.Variable(FIRE) can be 1 or 0
FloorE.fireres can be between 1 and 0.
to simplify things you can assign FloorE.physres to 0
p1hit.Variable(DMG) is calculated by player stasts and is constant

how the formula works…if enemy have 0 resist to fire it will double the damage of a fire sword.if enemy will assorb the dmg a Immune to damage txt is shown
What i want…
If the weapon doesn’t have any elemental (p1hit.Variable(FIRE) = 0) (and the enemy have a dynamic value of resistance to fire eg 50%)i just want the first part of the formula which do only white dmg.

you can change the formula as long as it has said variables

edit: i’m checking the formula again…
i still don’t get why the dmg is halved…the formula seems to work…

UPDATE: OK I UNDERSTAND WHY DMG IS HALVED.
when there is no fire element added (p1hit.Variable(FIRE)=0) and (FloorE.fireres=0.5),the second part of the formula is negative by half…
thaz why the result is halved…and is something i don’t want
Still looking for better solution .

Ok…i feel dumb…
had to replace additions with multiplications…