Maybe there is another solution. As from the xform you can get the global and the object matrix. You can store the difference between then, and then you can use it with the setAttr -time ... to get the value for each time.
It's just an idea, I didn't check it, so please, let me know if it works.
Good luck,
David