Product Price manipulation on add to cart

Hello Team,
Please help me to reaching out the solution how can i achieve a functionality like i have a product meta set in backend which contain % value of discount i need to add when a logged in user try to add a this product on cart but just like suppose

  1. Product A have meta value 20% then its price should reduce to 20% when it being added to cart.
  2. When in same cart product B added which contain 15% set then its price should reduce to 15%.

How can i achieve this I am a developer and also can able to create any kind of theme development and Shopify Functions Ajax API
So i can apply any kind of solution which please help to reaching out this functionality.
Please except shopify script.

Exisiting discounts aren’t enough to achieve this?