If I understand correctly, your store sells singles, 6 packs, and 12 packs. When a 6 pack is sold, you want it to deduct 6 singles from inventory.
This cannot be accomplished with liquid. You’ll need to use the Shopify Admin API. To use this safely, you’ll want to interact with it in a non public facing environment, like server side or in a server less function.
Alternatively, you can look for third party Inventory management software that integrates with Shopify. Basic inventory management software can handle kit/package SKUs that are made up of multiples of a single SKU.