You could probably add a column to the cart for individualDiscount and set it to zero when you add anything to the cart. Then you could add a discount rule to the cart that simply takes the total of that column and applies it as a discount.
Now your loop through the cart can update that column and the rest would work automatically.