Why does this variable stops incrementing sometimes?

It’s for Ironman and it’s been a long time bug that I have no idea how to fix. Here’s the code for the variable:

***I would ignore that one of the variables is named Ammo.

variables
{
global:
7: IsHidingPhase

player:
	0: Ammo
	4: Energy

}

rule("[IRONMAN]: ARC REACTOR (HUD)")
{
event
{
Ongoing - Each Player;
Team 2;
Pharah;
}

conditions
{
	Global Variable(IsHidingPhase) == False;
}

actions
{
	Set Secondary Fire Enabled(Event Player, False);
	Set Player Variable(Event Player, Energy, 100);
	Set Player Variable(Event Player, Ammo, 3);
	Create HUD Text(Event Player, String("{0}: {1}", String("Power", Null, Null, Null), String("{0}%", Player Variable(Event Player,
		Energy), Null, Null), Null), Null, Null, Top, 1, Aqua, White, White, Visible To and String, Default Visibility);
	Create HUD Text(Event Player, String("{0}: {1}", Custom String("Repulsor Ray", Null, Null, Null), String("{0}%", 10, Null, Null),
		Null), Custom String("(Secondary Fire)", Null, Null, Null), Null, Left, 1, Aqua, Red, White, Visible To and String,
		Default Visibility);
	Create HUD Text(Event Player, String("{0}: {1}", Custom String("Unibeam", Null, Null, Null), String("{0}%", 80, Null, Null), Null),
		Custom String("(Interact)", Null, Null, Null), Null, Left, 2, Aqua, Red, White, Visible To and String, Default Visibility);
	Create HUD Text(Event Player, Custom String("Arc Reactor Burst", Null, Null, Null), Custom String("(Ultimate)", Null, Null, Null),
		Null, Left, 3, Aqua, Red, White, Visible To and String, Default Visibility);
	Create HUD Text(Event Player, Custom String("Thrusters", Null, Null, Null), Custom String("(Hold Ability 1)", Null, Null, Null),
		Null, Left, 4, Aqua, Orange, White, Visible To and String, Default Visibility);
	Create HUD Text(Event Player, Custom String("Hover", Null, Null, Null), Custom String("(Hold Jump)", Null, Null, Null), Null, Left,
		5, Aqua, Orange, White, Visible To and String, Default Visibility);
	Create HUD Text(Event Player, String("{0}: {1}", Custom String("Laser", Null, Null, Null), String("{0} / {1}", Player Variable(
		Event Player, Ammo), 3, Null), Null), Custom String("(Interact)", Null, Null, Null), Custom String("Doesn't Reload", Null,
		Null, Null), Left, 6, Red, Red, Red, Visible To and String, Default Visibility);
	Create HUD Text(Event Player, Custom String("Ironman", Null, Null, Null), Null, Null, Top, 2, Yellow, White, White,
		Visible To and String, Default Visibility);
}

}

rule("[IRONMAN]: ARC REACTOR REGEN")
{
event
{
Ongoing - Each Player;
Team 2;
Pharah;
}

conditions
{
	Player Variable(Event Player, Energy) < 100;
}

actions
{
	disabled Skip If(Compare(Player Variable(Event Player, Energy), >, 100), 3);
	Wait(0.085, Ignore Condition);
	Modify Player Variable(Event Player, Energy, Add, 1);
	Loop If(Compare(Player Variable(Event Player, Energy), <, 100));
}

}

rule("[IRONMAN]: ARC REACTOR REGEN (Negative Values)")
{
event
{
Ongoing - Each Player;
Team 2;
Pharah;
}

conditions
{
	Player Variable(Event Player, Energy) <= 0;
}

actions
{
	Skip If(Compare(Player Variable(Event Player, Energy), >=, 100), 3);
	Wait(0.085, Ignore Condition);
	Modify Player Variable(Event Player, Energy, Add, 1);
	Loop If(Compare(Player Variable(Event Player, Energy), <, 100));
}

}

Normally people just use up all the power and then it starts climbing again. But they can only do that by flying and hovering because it’s the lowest use of power. Here’s the code for that:

variables
{
global:
7: IsHidingPhase

player:
	4: Energy

}

rule("[IRONMAN]: Jet Boosters")
{
event
{
Ongoing - Each Player;
Team 2;
Pharah;
}

conditions
{
	Is Button Held(Event Player, Ability 1) == True;
	Player Variable(Event Player, Energy) >= 2;
	Global Variable(IsHidingPhase) == False;
}

actions
{
	Modify Player Variable(Event Player, Energy, Subtract, 2);
	Abort If(Has Status(Event Player, Knocked Down));
	Abort If(Has Status(Event Player, Stunned));
	Abort If(Has Status(Event Player, Asleep));
	Abort If(Has Status(Event Player, Rooted));
	Abort If Condition Is False;
	Play Effect(All Players(All Teams), Good Explosion, Aqua, Subtract(Position Of(Event Player), Vector(X Component Of(Event Player),
		3, Z Component Of(Event Player))), 0.500);
	Wait(0.125, Ignore Condition);
	Apply Impulse(Event Player, Facing Direction Of(Event Player), 20, To World, Cancel Contrary Motion);
	Loop If Condition Is True;
}

}

rule("[IRONMAN]: Hover")
{
event
{
Ongoing - Each Player;
Team 2;
Pharah;
}

conditions
{
	Is Button Held(Event Player, Jump) == True;
	Player Variable(Event Player, Energy) >= 1;
}

actions
{
	Abort If(Has Status(Event Player, Knocked Down));
	Abort If(Has Status(Event Player, Stunned));
	Abort If(Has Status(Event Player, Asleep));
	Abort If(Has Status(Event Player, Rooted));
	Wait(0.150, Ignore Condition);
	Modify Player Variable(Event Player, Energy, Subtract, 1);
	Apply Impulse(Event Player, Vector(0, 50, 0), 1, To World, Cancel Contrary Motion);
	Apply Impulse(Event Player, Vector(0, -25.000, 0), 1, To World, Cancel Contrary Motion);
	Play Effect(All Players(All Teams), Good Explosion, Aqua, Subtract(Position Of(Event Player), Vector(X Component Of(Event Player),
		3, Z Component Of(Event Player))), 0.500);
	Loop If Condition Is True;
}

}