Mythical
Each time a Spell Card is activated, place 1 Spell Counter on this card when that Spell resolves. Gains 500 ATK for each Spell Counter on it. At the end of the Battle Phase, if this card battled, remove all Spell Counters on it.
local COUNTER_ID_0 = 0x1 --Spell

local COUNTER_ID_0 = 0x1 --Spell
local s, id, o = GetID()
function s.initial_effect(c)
	c:EnableCounterPermit(0x1)
	--add counter
	local e0 = Effect.CreateEffect(c)
	e0:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD)
	e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
	e0:SetCode(EVENT_CHAINING)
	e0:SetRange(LOCATION_MZONE)
	e0:SetOperation(aux.chainreg)
	c:RegisterEffect(e0)
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD)
	e1:SetCode(EVENT_CHAIN_SOLVED)
	e1:SetRange(LOCATION_MZONE)
	e1:SetOperation(s.acop)
	c:RegisterEffect(e1)
	--attackup
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_UPDATE_ATTACK)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetValue(s.attackup)
	c:RegisterEffect(e2)
	--remove counter
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e3:SetCode(EVENT_PHASE + PHASE_BATTLE)
	e3:SetCountLimit(1)
	e3:SetRange(LOCATION_MZONE)
	e3:SetCondition(s.condition)
	e3:SetOperation(s.operation)
	c:RegisterEffect(e3)
end
function s.acop(e, tp, eg, ep, ev, re, r, rp)
	if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and e:GetHandler():GetFlagEffect(FLAG_ID_CHAINING) > 0 then
		e:GetHandler():AddCounter(COUNTER_ID_0, 1)
	end
end
function s.attackup(e, c)
	return c:GetCounter(COUNTER_ID_0) * 500
end
function s.condition(e, tp, eg, ep, ev, re, r, rp)
	return e:GetHandler():GetBattledGroupCount() > 0
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local n = c:GetCounter(COUNTER_ID_0)
	if n ~= 0 then
		c:RemoveCounter(tp, COUNTER_ID_0, n, REASON_EFFECT)
	end
end


Mythical
Each time a Spell Card is activated, place 1 Spell Counter on this card when that Spell resolves. Gains 500 ATK for each Spell Counter on it. At the end of the Battle Phase, if this card battled, remove all Spell Counters on it.
-- Mythical
local COUNTER_ID_0 = 0x1 --Spell
local s, id, o = GetID()
function s.initial_effect(c)
	c:EnableCounterPermit(0x1)
	--add counter
	local e0 = Effect.CreateEffect(c)
	e0:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD)
	e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
	e0:SetCode(EVENT_CHAINING)
	e0:SetRange(LOCATION_MZONE)
	e0:SetOperation(aux.chainreg)
	c:RegisterEffect(e0)
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD)
	e1:SetCode(EVENT_CHAIN_SOLVED)
	e1:SetRange(LOCATION_MZONE)
	e1:SetOperation(s.acop)
	c:RegisterEffect(e1)
	--attackup
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_UPDATE_ATTACK)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetValue(s.attackup)
	c:RegisterEffect(e2)
	--remove counter
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e3:SetCode(EVENT_PHASE + PHASE_BATTLE)
	e3:SetCountLimit(1)
	e3:SetRange(LOCATION_MZONE)
	e3:SetCondition(s.condition)
	e3:SetOperation(s.operation)
	c:RegisterEffect(e3)
end
function s.acop(e, tp, eg, ep, ev, re, r, rp)
	if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and e:GetHandler():GetFlagEffect(FLAG_ID_CHAINING) > 0 then
		e:GetHandler():AddCounter(COUNTER_ID_0, 1)
	end
end
function s.attackup(e, c)
	return c:GetCounter(COUNTER_ID_0) * 500
end
function s.condition(e, tp, eg, ep, ev, re, r, rp)
	return e:GetHandler():GetBattledGroupCount() > 0
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local n = c:GetCounter(COUNTER_ID_0)
	if n ~= 0 then
		c:RemoveCounter(tp, COUNTER_ID_0, n, REASON_EFFECT)
	end
end

