Woocommerce change price in cart when discounted

You can use this filter in your theme or plugin to filter the product prices:

function filter_woocommerce_price( $price, $product ) { 

    // 1. Set your $price_percent variable
    // 2. Subtract the price_percent from the price $price - $price_percent
    // 3. Set the new $price

    return $price;
} 
add_filter( 'woocommerce_product_get_regular_price', 'filter_woocommerce_price', 10, 2 );

By the way – you can use $product->get_id() within function.