ID:1929123
 
(See the best response by Kaiochao.)
Code:
for(var/obj/Items/Potions/WeakHP/b)
if(!b in usr)
var/obj/B=new/obj/Items/Potions/WeakHP
B.loc= usr
B.addAmount(1)
usr<<"test1"
return




else if(b in usr)
b.addAmount(2)
b.suffix="[b.amount]"
usr<<"test2"
return


Problem description:

I think you want to use locate(type).

Examples (both are the same thing):
var found_potion = locate(/obj/Items/Potions/WeakHP) in container

var obj/Items/Potions/WeakHP/found_potion = locate() in container
Best response
!b in usr // wrong
!(b in usr) // fixed

What your code does (after applying the above fix):
do this for every WeakHP potion in the world:
    if this potion isn't in usr
        create a new WeakHP potion
        move new potion to usr
        call new potion's addAmount(1)
        stop the proc now

    else, if this potion is in usr (this "if" is redundant)
        call this potion's addAmount(2)
        set this potion's suffix
        stop the proc now


What you probably want:
give usr 2 new WeakHP potions


In DM,
var obj/Items/Potions/WeakHP/potion = locate() in usr
if(potion)
potion.addAmount(2)
else
potion = new (usr)
potion.addAmount(1)


In more general DM,
mob
proc/addItem(ItemType, Amount = 1)
var obj/Items/item = locate(ItemType) in usr
if(item)
item.addAmount(Amount)
else
item = new ItemType (usr)
item.addAmount(Amount - 1)

// give usr 2 WeakHP potions
usr.addItem(/obj/Items/Potions/WeakHP, 2)


It looks like you have some misconceptions about the "for()" control structure; what it means, what it does, what it's generally used for.

DM Guide, Chapter 6.17.1: for list loop
DM Reference: for list
Ive got misconceptions about all of this XD. Its why i program to learn. Appreciate the advice, I'll try and incorporate and play with this until it sits right. Thank you.
drag and drop perfectly worked, ty. Now to compare and learn better for the next scenarios