Finite State Machine

This might look like a necropost… but Im viewing this same state machine… yet when I import the code into the project its not recognized because it id not a playcanvas entity script… How did you modify it or wrap it so you can use it? thanks