You can use both a discount code & passworded tickets together.
To see how to set up a passworded ticket please head here.
Once your passworded ticket is set up you can go ahead and create your discount code. To use a password and discount code in conjuction, the code needs to be exactly the same.
To see how to add a discount code please head here.
When both ticket and discount code are set up, the customer can enter the code in the promo code box on the listing. This will unlock the ticket and apply the discount.