There's too much going on here and you cut off the top part of that important event in the screenshot. The first problem is that even though you run the function for each enemy, inside the function it doesn't automatically relate to that enemy, you need to pick it again inside the function by passing through a parameter. In the top event there are too many conditions really and is it running every tick? I cannot tell as you chopped off the top part of that event.
Before you repeat you need to make sure it's running correctly one time for an enemy which it probably is not doing unless you have just one enemy in the level. What you could do is move everything inside the function, decrease the variable inside there. Run the function and send the enemy's UID through as a parameter, then inside the function pick the enemy from UID, and use a condition movement variable > 0 and loop through the movements.