Add parse_duration() which parses a duration and return the number
of frames for the duration.

Part of #421
Change cooldown and delay to use the new parse_duration()

Part of issue #421
Make use of parse_duration() for cooldown attributes.
Updated map event cooldown to use the new parse_duration().
Remove debug fprintf.
Merge pull request #422 from hean01/timeunit

Adds parse_duration() and updates cooldown to use this.