Hi,
In our commercial editions, you can set restrictions to coupons. You could create a coupon with a product and a category restriction and auto load it on the checkout.
That way, if in the cart the is product A and a least a product of category B, the coupon is automatically added to the cart.