How to add advanced rule for category quantity specific hide rule

Just as product quantity based advanced rules, the Hide Shipping Method for WooCommerce Plugin lets you apply conditions related to the collective quantity of a whole category. 

Though it works exactly the same, the total quantity of products belonging to the respective category is taken into consideration for this case, instead of products’ separate quantities.

How to add advanced rule for category quantity specific hide rule