Hi,
Thank you for posting brief information about the project. It could be easily create and implemente in wordpress.
This could be achieved using HTML, CSS and PHP.
To create Affiliate Discount Code Template, I will do below steps:
1) First convert design into HTML
2)On get code, add jquery function so if user mouse over the button, it will show the coupon code Once user will click, it will copy(I am not sure if you want this functionality).
3) Show terms/How to use - it will a page link. It will have details information about the template page
4) Add your comments - It is not clear for me. Once you will consider my proposal or want to talk then we will discuss and decide
5) Add the expiry timer of the coupon code using the JavaScript
6)About the times used - we can add counter on the click of the coupon code
Kindly let me know if you need more information.
Thanks