To make your code work, I think that you only need to write anim.Stop("shoot"); at line 13 instead of anim.enabled = false;
But there is a difference between animation & animator and it’s not the appropriate way to use the animator component
It’s more useful to create an animator if the character have several animations which can bridge between them
I advise you to create an animator for your character ( simple and efficient )
You can look there : The Animator Controller - Unity Official Tutorials - YouTube
In the other case, you can use the animation component which work like you did above.