Help with AI, i want to alternate movement and attacks.

Hi, i’m dealing with a problem in which my boss is too easy to beat with low values, and with medium/hard values of damage it’s almost impossible to outdamage it, the thing is that i have some long range attacks but they are almost only triggered at the begging of the fight when the player is reaching the enemy, once the enemy is within a close range it will only melee attack and keep attacking until either it dies or the player dies. The thing is, i wanted to implement a function to alternate the attacks and a certain movment to target points, that way the AI would move to that point, then attack long range and then once it reaches the player again attack close range and repeat, sadly it didn’t worked and i wanted to know why.
this is my script that changes attack animations and i wanted to try adding the function move to location when the requierements to attack are fulfilled

sorry the pic attaching got messy
second pic: move to patrol point
third pic: my seek player loop
fourth: the end of the first pic
fifth: the end of the 2nd pic :confused: