//This is how I create new Cooldown and return if data exist const cmd = client.commands.get(command) || client.commands.find(a => a.aliases && a.aliases.includes(command)) if (cmd) { if (cmd.cooldown) { const cools = require("./Schema/cooldown"); cools.findOne({ guildID: message.guild.id, userID: message.author.id, command: cmd.name }, async(err, data) => { const cd = await cools.findOne({ guildID: message.guild.id, userID: message.author.id, command: cmd.name }) if (data) { let dateNow = ms(cd.coolDown - Date.now(), { long: true }) const embed = new MessageEmbed() .setDescription(`You already used ${cmd.name} command.`) .addField("Cooldown Time:", `${dateNow}`) .setColor('RANDOM') .setTimestamp() message.channel.send({ embeds: [embed] }) return } else { if (cmd) cmd.execute(client, message, args, prefix) if (!cd) { new cools({ guildID: message.guild.id, userID: message.author.id, coolDown: Date.now() + cmd.cooldown, command: cmd.name }).save() } } }) } } //This is the part that i was thinking to delete the existing command. let x = cd.coolDown - Date.now() setInterval(async() => { if (x <= 0) { await cools.findOneAndRemove({ guildID: message.guild.id, userID: message.author.id, command: cmd.name }) } }, x)