The red is hot in, the green is "common," the solid white is timed load, the white with black stripe is CC input. It's probably shot since it's melted, although I have seen timers melted so bad the harness was fused to it and it still worked.
If you have any other 24V timer, you can get the...