How do I translate animation[.name].time into Unity5 compatible C# code?

Hi,

I am following a tutorial right now and while i could easily convert all other animation commands with GetComponent, i am not finding any solution to this one:

if(animation[attack.name].time>0.9*animation[attack.name].length) 

Note: What this is supposed to do in the bigger script, is to inflict dmg against the enemy at a certain point of the animation and stop the animation after a certain amount of time of the animation

Any help with converting this particular commands or finding a workaround is appreciated.

Also I would like to know how to import legacy animations into the animator controller, because many models in the Asset Store are using those and its way easier to work the animator controller.

Greetings

This is embarassing, but hey: for everyone else who is looking at this problem, it is:

if(GetComponent<Animation>()[attack.name].time>0.9* GetComponent<Animation>()[attack.name].length)

Still - how can i use legacy animations with the animator controller?