Combination of advanced X-ray spectroscopy and quantum chemistry to determine electronic structures of metal-organic cofactors in proteins