There is a bit more efficient approach for this case: since all needed information to check target values is present in results of the initial search, just adapt the check to work based on them. It can be implemented in various ways, below is one for example:
gg.clearResults()
gg.searchNumber("119;1;16777216::50", gg.TYPE_DWORD)
local results = gg.getResults(gg.getResultsCount())
local expectedValueAddresses = {}
for i, v in ipairs(results) do
if v.value == 16777216 then
expectedValueAddresses[v.address] = true
end
end
gg.refineNumber("119", gg.TYPE_DWORD)
local targetValues = {}
for i, v in ipairs(results) do
if expectedValueAddresses[v.address + 0xC] then
targetValues[#targetValues + 1] = {
address = v.address,
flags = v.flags,
value = 25,
freeze = true,
name = "SKILL"
}
end
end
gg.addListItems(targetValues)