It seems you want to provide the discount coupon to the referee on the referral purchase.
The requirement you want can easily achieve from our plugin. You just have to follow these steps-
1. You have to visit WooCommerce > Settings > Referrals > General referrals
2. Firstly you have to enable Enable coupon referral program settings.
3. Set Referral discount amount type = Percentage
4. Referral discount amount up to = 20
5. Referral discount = 10 and save the changes
6. Now you have to visit the Coupon Configuration tab and set Referral Coupon type = Fixed and save the changes.
Now you the customer can refer to another customer and get the discount coupon according to the setting.