So after digging through a LUA guide and checking the factorio modding guide, I was able to modify the "take" and "put" functions to do what I was looking for. I will paste the modifications here if anyone is interested. This in in the control.lua file.
function take(surface,inv,item,amount)
if not global.pool[surface.name] then global.pool[surface.name] = {} end
if not global.pool[surface.name][item] then global.pool[surface.name][item] = 0 end
if global.restricted[item] == true then return end
local maxstore = 99999
if global.pool[surface.name][item] + amount > maxstore then amount = maxstore - global.pool[surface.name][item] end
if amount <= 0 then return end
global.pool[surface.name][item] = global.pool[surface.name][item] + amount
inv.remove({name=item, count=amount})
end
function put(surface,inv,item,amount)
if not global.pool[surface.name][item] then return end -- ignore if item isn't in pool
if inv.get_insertable_count(item) < amount then amount = inv.get_insertable_count(item) end
local content = inv.get_contents()
local needed = amount
if content[item] then needed = needed - content[item] end
if needed <= 0 then return end
if global.pool[surface.name][item] < needed then needed = global.pool[surface.name][item] end
if needed <= 0 then return end
global.pool[surface.name][item] = global.pool[surface.name][item] - needed
inv.insert({name=item, count=needed})
end