Hey, thanks for having a read through :)
so without seeing the rest of the code I can see why that could look odd, Its set there simply because there is a cool down on the pursue speed when the enemy reaches the player. Say the enemy reaches you, but you run away, I didn't want the skeleton to immediately chase you constantly. so I just reduce the pursue speed to 0, and then there's a timer that ticks down to say when they can pursue again.
If the player moves far enough away from the enemy, they will return to their ROAM state. so in that case i wanted to just hard reset it there, so if the player gets close again the enemy would resume at the correct speed.
I could've also temporarily stopped the path action, but I didn't think it would hurt to keep that going and checking the players position for when they can move again. and instead just reduced the speed.
I should mention i'm still very much learning a lot about code, so I don't always get it right or have the most efficient approach. but i'm getting better. I've been dabbling on and off with different projects since about 2018, but i'm a silly artist that hates math, so my progress isn't the fastest.
Again thanks for commenting.