I did it in GUI, with a couple bugs.
Your c_xp_abil variable seems to shift between an effect and a string. I don't think I can do that in GUI, so I used two variables, one string and one effect.
I couldn't find a UnitXPTotal function, just a Get Experience Level function. If it really doesn't exist, you'll have to set the curXP variable in HeroGetRequiredXP via custom script.