use the cart conditionalTotal command.
for the coupon calculation use a flat rate and enter:
$this->ConditionalTotal("TotalPrice", "CouponColumn", "1") * 0.20
this sample assumes the coupon column is named CouponColumn, and the value stored in this column be the add to cart is 1.