Typhoon Chanthu weakens towards Taiwan