Scientists in Wales may have found a solution to the global chocolate crisis caused by a cocoa shortage.