How to add attack speed using commands?

In version 1.9, the combat section of the update added a cooldown timer. My problem lies with the fact that some Minecraft maps have no cooldown, and replace it with attack speed (attack speed increases the cooldown).
So what command adds attack speed to tools?


One way is to use item attributes. I've seen this approach on a few maps.

Using the command

/give @p diamond_sword 1 0 {AttributeModifiers:[{AttributeName:"generic.attackSpeed",Name:"generic.attackSpeed",Amount:1000,Operation:0,UUIDLeast:1,UUIDMost:1}]}

You can give yourself a diamond sword with the maximum attack speed on it. This eliminates the cooldown of attacks.

(PS: you can find more about attributes on the wiki, here)