Cosmos battle to win 4-2 against Puerto Rico FC