Hello friend, in addition to "state machine" this package was made to offer predefined character models. The variables regarding speed and gravity, are within the character, this in turn, shares this data to the states they need.
I don't know if my content is useful (because it's in Spanish) but I have a couple of tutorials on the state machine :).
https://indielibre.com/2019/05/07/godot-engine-como-crear-una-maquina-de-estados...