print_dbg = magazines.print_dbg is_magazine = magazine_binder.is_magazine GetCost = utils_item.get_item_cost function utils_item.get_item_cost(obj, profile) if not utils_item.on_get_item_cost and is_magazine(obj) and obj:parent() and obj:parent():id() == 0 then print_dbg("reducing mag cost %s", obj:section()) return math.floor(GetCost(obj, profile) * 0.1) else return GetCost(obj, profile) end end