It does not matter how many states pass such a law, to the extent that it affects the power of non-cooperating states in the selection of the President, it is an unconstitutional confederation (Article I, section 10).
OF course, 2/3 of the states can call a convention, amend the constitution (If 3/4 of the states agree), and thereby git 'er done.
But the California proposal is unconstitutional.
Couldn't California and other states just put in their state law that it won't take effect until a certain number of other states do as well?
This wouldn't be a contract, compact or confederation as agreements with other states would be not be necessary.