How do i do this?

I want an update that adds a set amount of point gain instead of multiplying

……. What

if (hasUpgrade(“layer”, id) gain = gain.add(number)