Hi,
You want to implement the event onAfterLoadProductPriceDiscount(&$discounts, &$rows, $filters, $trigger_options) in a plugin of the group "hikashop"
$discounts contains an array of the discounts loaded from the database
$rows contains a product object or an array of product objects for which the discounts are being loaded
$filters contains an array of MySQL conditions which were used to load the discounts
$trigger_options contains some options like the user_id, the zone_id, the currency_id, the ids of the products, the ids of the variants
So you want to set your own discount objects in $discounts. You need to make sure that in each discount, you have a discount_product_id which matches with the corresponding product / variant.
HikaShop will then automatically apply the discounts to the products / variants.