Hey, I haven't tested this or anything but its just a gut feeling. Swap the bottom part with this:
Lua Code:
CastingBarFrame:HookScript('OnUpdate', function(self, elapsed)
if not self.timer then return end
if self.update and self.update < elapsed then
if self.casting then
self.timer:SetText(format("%.1f", max(self.maxValue - self.value, 0)))
elseif self.channeling then
self.timer:SetText(format("%.1f", max(self.value, 0)))
else
self.timer:SetText("")
end
self.update = 0.1
else
self.update = self.update - elapsed
end
end)