that would be easy with a trigger but here is data only:
set, validator: target hp >=1 and caster shields >=1
effect1: damage target 1
effect2: modify unit caster shields -=1
effect3: this set
if the numbers are bigger this might lag then you could use
validator1 target hp>=100,caster shields >=100
effect1 set (with numbers changed to 100) and instead of calling itself in effect3: call this switch again
validator2 target hp>=10,caster shields>=10
effect2: set (with numbers changed to 10) ...
etc inflate numbers as necessary.
ps: what kueken said