Theres not a way to do that in the cart object, it would require hand coding to accomplish.
you would need to create a cart loop, look at each ID line by line and if the id matches add the quatity of the 2 together, then calculate the discount.
This kind of custom coding is beyond the scope of this support forum, we could help you implement this in a premiere support appointment:
http://www.webassist.com/premier_request.php