I'm not 100% sure on how your timer works, but I would imagine the get_ticks() function returns how many ticks there have been since the last time it was called?
If so, then you should only call get_ticks() once per cycle (at the beginning of the main while loop in your case) and store this in a variable. Then use this value for both the player and the enemy.
As you are calling get_ticks() for each entity, there are less ticks happening between the call for the first entity and the second entity than there are between the second and the first, because of all the other stuff happening in between,
Let me know if this works or not!