How to temporarily change a variable?

Make a variable e.g. FireSpeedBoost (default to 0). When the effect is on set it to the desired additive boost value (delta boost). Then just always add FireSpeedBoost to your normal FireSpeed and store that in a new variable or plug it directly into whatever you need it for. When the effect is over just set your boost to 0 again.

I’m trying to create an ability that increases the player’s shot speed and damage for a short period of time. This is how I’ve tried so far:

What ends up happening is: it sets the temp variables correctly, it sets the new shot speed and damage correctly, then when the ability ends it sets the shot speed and damage to 0.