Remove the discount if the customer uses the second automatic buy one, get one free discount

Hello,

I’m attempting to use JavaScript to remove a “buy one, get one” automatic discount from the cart page if a customer tries to apply the discount a second time, or prevent them from using any other discount option.

Thanks

You mean at checkout? I don’t think you can add more than one discounts in checkout

no, i want to remove discount using javascript in cart and checkout page