DISPLAY
function()
	local function round(var, n)
		if (n) then
			var = math.floor((var * 10^n) + 0.5) / (10^n)
		else
			var = math.floor(var+0.5)
		end
		return var
	end
	if UnitAffectingCombat("player") == true then
		aura_env.endTime = math.floor(GetTime())
	end
	local ppm = aura_env.procs / ((aura_env.endTime - aura_env.startTime) / 60)
	ppm = ppm / 60
	return round(ppm, 2)
end

--COMBAT_LOG_EVENT_UNFILTERED
function(...)
	local subevent = select(3, ...)
	if subevent == "SPELL_AURA_APPLIED" then
		local caster = select(6, ...)
		local bname = select(14, ...)
		if caster == UnitName("player") and bname == aura_env.bname then
			aura_env.procs = aura_env.procs + 1
			local expTime = select(7, UnitBuff("player", aura_env.bname))
			aura_env.expTime = expTime
		end
	end
end

--PLAYER_REGEN_DISABLED
function() --Enable timer on start combat
	aura_env.startTime = math.floor(GetTime())
	return true
end

--PLAYER_REGEN_ENABLED
function() --Disable timer on end cobat
	aura_env.endTime = math.floor(GetTime())
	return true
end

--EVERY FRAME TRIGGER
function()
	if UnitBuff("player", aura_env.bname) then
		local expTime = select(7, UnitBuff("player", aura_env.bname))
		--print(expTime, aura_env.expTime)
		if expTime ~= aura_env.expTime then
			aura_env.procs = aura_env.procs + 1
		end
		aura_env.expTime = expTime
	end
end

INIT
aura_env.bname = "Meat Cleaver"
aura_env.startTime = 0
aura_env.endTime = 0
aura_env.procs = 0
aura_env.expTime = 0