Yoyo, I kinda wasted my freetime on the issue and other stuff I came across, the tism was kickin.
Please check out the update und tell me how it works live, I could only do some headless testing and will be away still for a while.
Hope u like my adjustment to your merged freshness calculation, since it felt kinda very unvanilla to suddenly merge it across the whole inventory and persoanlly I'm very obsessed with getting rid of stuff that's soon to spoil. I settled for a system of 3 levels of freshness to keep the clicking to a reasonable amount.
And just to let you know, when I tested ur code I had some trouble with the calculations carrying over between seperate actions, manipulating the merged freshness across actions.