Cyclic cocycles from graded KMS functionals