Auto Battler Targeting

Hi everyone, I am still really struggling with figuring out this auto battler system. Think like Ogre Battle from the SNES days. Here is my code.

So Currently the top part works just fine, my units will run in the direction they are supposed to so I know that the team variable is changing. However, I also need these guys to battle and not just move in a direction so I need to get them to target each other and be separate entities.

I have checked out some other topics on the forum but I am missing something with the targeting.