hmm...
... is 4 the 'cosmic number' because the word 'FOUR' has four letters ?.....
If that is the answer, then it would also work for the other examples you gave:
(twelve has six letters, six has three letters, three has five letters....and so on)
12 is 6, 6 is 3, 3 is 5, 5 is 4 and 4 is the cosmic number
20 is 6, 6 is 3, 3 is 5, 5 is 4 and 4 is the cosmic number
8 is 5, 5 is 4 and 4 is the cosmic number
21 is 9, 9 is 4 and 4 is the cosmic number
sorry if you already worked it out, anyway this is my guess
...