The amount of used entity skills does not matter. They don't have an impact on the FPS.
At a first glance nothing in your code should cause such a slow code execution.
Perhaps the slowdown is caused by one of the functions which are called in your code (avoid_obstacle, attach_to_ground, handle_animation etc).
You could comment out these function calls one by one to track down the troublemaker.
Well, I hope this helps!