Japan pledges help in terrorism fight