Yeah, sure.
First thing you do is store all cast times in an arrayed variable.
Then, when a spell is cast, you check which cast-time matches with that spell (such as: if ability being cast equal to storedAbility[2], then use storedCastTime[2]).
I hope it's still clear here
Then, whenever the ability is cast, create a dummy unit (no model, locust, not shown on map, no shadow etc). Save the cast time, "0.00", the coordinates (or location) and any other values (such as the ability name or whatever you want) in a hashtable, with as key the ID of the dummy you just created.
Put the dummy in a unit group and run another (repeating) trigger.
This repeating trigger will create the floating texts.
Create an empty string.
If your cast time is 5.00 sec, and you are already casting it for 3.00 sec, the current percentage is 60%, right (3 * 100 / 5)?
And let's say you have 20 "|"s in your bar (||||||||||||||||||||), then you must fill it to 60% of that bar, which is 12 (20 * 0.6).
1 such line ("|") represents 5% of the entire progress bar. So:
loop from 0 to 20
If ({current cast time} >= {total cast time} * (0.05 * {loop integer}) then
set string variable = string variable + (colored |)
else
set string variable = string variable + (white/grey |)
The "{total cast time} * (0.05 * {loop integer})" is simple: you increase the loop by 5% at a time (remember what I said before? 5% is equal to 1 line in the entire progress bar).
I hope you could follow all of this. If not, I'd be glad to make a test-map out of it.