Subtract single value from each number in a field where cells contain multiple values


I have an inventory tracking challenge that I’m having difficulty with

In my line of work clients order resources. Each resource contains a number of items from my stock room. I want to track inventory of items automatically based on resource orders that clients make. I think I need a formula that says "hey! a resource has been ordered.That resource contains items A,B,C…Let’s subtract “quantity items used” from “item inventory level.”

Note: The quantity of items used will vary based on the number of participant the client wants to use the resource for.

I haven’t gotten very far with this but the image below gives you the idea. I want to subtract 40 from the stock levels contained within records 114, 110, 107, 105, 104 and 112. I’ve learned a lookup isn’t the way to go but now I’m stuck.