You can pretty much copy my module from oUF_Lumen.
https://github.com/greven/oUF_Lumen/.../bartimers.lua
Check here on how to call them:
https://github.com/greven/oUF_Lumen/...its/player.lua
You'll still need a PostUpdate function and a list of buffs / debuffs to track.
Hope it helps you.