Weapon disarming works off of a multiplicative threshold formula, where:
X is equal to the amount of damage taken while holding the item ÷ the item's damage threshold
Y is equal to the force of the attack ÷ item's force threshold
and if X*Y is greater than or equal to 1, the held item is dropped (See https://i.imgur.com/wKUM4Xz.png for a visual)
There are different thresholds for different items:
Bombs, Mines, Spikeballs, Brawlballs, Water bombs, Tables, Flags, Boomerangs: 1 damage, 1 force
Horn: 35 damage, 40 force
Weapons (and all items not listed here): 70 damage, 65 force
Note that damage is counted only while holding the weapon, and is separate for each "instance" of a weapon - throwing a weapon and picking it back up doesn't reset the damage counter, and X and Y are both capped at 2.