It's possible, but I think most of it has to be done manually.
If the unit has "Stun" buff, you need to detect from wich skill it's the stun. For that, you need to create a Stun buff for each ability, and each ability level. Same for all the other effects. Then cast your "Keep Buff in a Bottle" in the unit, detect wich buff the unit has, and add the respective ability to the caster.