Diamond swords in the first slot of your hotbar will no longer have a cooldown.
How to install
How to import this command into your world
First, you must give yourself a command block (If you are on a server, you must be 'OP'ed, and have access to /gamemode 1)
To get a command block, type
/give @p command_block in the chat.
Once you have a command block, right click it to open it's GUI.
Now, you must copy and paste the command from your browser into the game. Select the entire command from below, then right click and press 'copy'.
Next, go back to your minecraft world, and paste the command you just copied into the command block. There are a few different keys that may be used to do this, depending on your keyboard. The most common ones are 'CTRL + V', 'COMMAND + V', or 'STRG + V'
Finally, you can press done to exit the GUI, and execute the command block by powering it with a redstone block, a lever, or any thing you can get your grubby hands on. Just make sure you don't place it on top of the command block, or the machine will not be installed!
Show source commands
# This user did not upload the source commands!
summon falling_block ~ ~1 ~ {Block:stone,Time:1,Passengers:[{id:falling_block,Block:redstone_block,Time:1,Passengers:[{id:falling_block,Block:activator_rail,Time:1,Passengers:[{id:commandblock_minecart,Command:"gamerule commandBlockOutput false"},{id:commandblock_minecart,Command:"fill ~2 ~-3 ~-1 ~7 ~-1 ~1 stained_hardened_clay 3 hollow"},{id:commandblock_minecart,Command:"fill ~2 ~-2 ~-1 ~7 ~-2 ~1 stained_glass 0 0 stained_hardened_clay"},{id:commandblock_minecart,Command:"/tellraw @p [\"\",{\"text\":\"Removed attack cooldown command\",\"color\":\"red\",\"bold\":true,\"insertion\":\"/tellraw @p %s\"}]"},{id:commandblock_minecart,Command:"/tellraw @p [\"\",{\"text\":\"Created by Apocalyptic47 through the use of MrGaretto's Command Combiner\",\"color\":\"red\",\"bold\":true,\"insertion\":\"/tellraw @p %s\"}]"},{id:commandblock_minecart,Command:"/give @p written_book 1 0 {pages:[\"[\\\"\\\",{\\\"text\\\":\\\"The removed cooldown effect only works on diamond swords at the moment.\\\",\\\"bold\\\":true},{\\\"text\\\":\\\"\\\\n\\\\nTo use, simply place any diamond sword in slot 1 of your hotbar.\\\",\\\"color\\\":\\\"reset\\\"}]\"],title:\"NOTE/HOW TO USE\",author:Apocalyptic47}"},{id:commandblock_minecart,Command:"fill ~3 ~-2 ~ ~6 ~-2 ~ chain_command_block 5"},{id:commandblock_minecart,Command:"setblock ~3 ~-2 ~ repeating_command_block 5"},{id:commandblock_minecart,Command:"blockdata ~6 ~-2 ~ {auto:1,Command:\"/setblock ~-2 ~ ~ minecraft:chain_command_block 13 replace {auto:1b,Command:\\\"/effect @a[tag=sword] haste 1 255\\\"}\"}"},{id:commandblock_minecart,Command:"blockdata ~5 ~-2 ~ {auto:1,Command:\"scoreboard players remove @a sword\"}"},{id:commandblock_minecart,Command:"blockdata ~4 ~-2 ~ {auto:1,Command:\"/effect @a[tag=sword] haste 1 255\"}"},{id:commandblock_minecart,Command:"blockdata ~3 ~-2 ~ {auto:1,Command:\"/scoreboard players tag @a add sword {SelectedItemSlot:0,Inventory:[{Slot:0b,id:\\\"minecraft:diamond_sword\\\"}]}\"}"},{id:commandblock_minecart,Command:"setblock ~ ~ ~1 command_block 0 0 {Command:\"fill ~ ~-3 ~-1 ~ ~ ~ air\"}"},{id:commandblock_minecart,Command:"setblock ~ ~-1 ~1 redstone_block"},{id:commandblock_minecart,Command:"kill @e[type=commandblock_minecart,r=1]"}]}]}]}