Will the cooldown be reduced by 20%, or is the cooldown based on CDR when the ability is cast?
An ability is placed on cooldown relative to the CDR you had at cast time. Buying a CDR item (or entering a CDR aura, like Soul Shroud) will not impact the remaining cooldown time on abilities currently on cooldown. They will impact any future casts thereafter, however.
(Source - "Cooldown reduction is determined at the moment an ability is activated. Increasing/decreasing your cooldown reduction while the skill is on cooldown will not affect the cooldown.")