Or you could do this:
Create a dummy unit with enough HP, no HP regen, no armor and I suggest you use divine armor (set all the damage values to 1.00, so it always takes 100% damage).
Create the unit whose base attack you want to store and attack the unit (only once!)
The dummy's max HP - the dummy's current HP should be about the base damage.
Of course, if some units have damage like 10-20, then it could differentiate from time to time.
There is no foolproof way of doing this without having to create variables to store all data in.
Either way, it's something Blizzard should have added, but didn't.