Hi,
that's fine to check a value on everyframe, but you could be cleaner by not everytime set the mass.
you should set the mass once when the player jumps, then watch for when the velocity will indicated a call, and only then edit the mass, and exit this check until the next jump.
Bye,
Jean