Optical switching properties of RCo<SUB>2</SUB>-type alloy thin films by electrochemical hydrogenation