Basic cohomology of topological quantum field theories