Let $\mathit{cLieGrp}^{\mathrm{inj}}$ be the category of compact connected Lie groups, and injective continuous group homomorphisms. Is there a reasonable functor (some kind of degree $3$ differential cohomology?) $$ F:\mathit{cLieGrp}^{\mathrm{inj}} \to \mathit{Ab} $$ to the category of abelian groups with the following features:

(1) On the full subcategory of compact semisimple Lie groups, this functor agrees with $G\mapsto H^3(G,\mathbb Z)$ (integral 3rd cohomology of the underlying manifold of $G$).

(2) On the full subcategory of compact abelian Lie groups (tori), this functor agrees with $T\mapsto H^4(BT,\mathbb R)$.

Motivation for the question:

The functor $$G \mapsto \{ \text{full WZW models with gauge group } G\}$$ seems to behave like the functor $F$ above (except that the set of full WZW models with gauge group $G$ needs to be group-completed in order to make it into an abelian group).